code cleanup (by using function to reset delay counter)
[rocksndiamonds.git] / src / init.c
index fbd103da06dece9cb8f34c5f18822cae05964563..6ccc8822c02361fb4c4d51c5e74206857ee1e3c3 100644 (file)
@@ -4664,7 +4664,7 @@ void InitElementPropertiesEngine(int engine_version)
                                                  i == EL_BLACK_ORB));
 
     // ---------- COULD_MOVE_INTO_ACID ----------------------------------------
-    SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (ELEM_IS_PLAYER(i) ||
+    SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (IS_PLAYER_ELEMENT(i) ||
                                              CAN_MOVE(i) ||
                                              IS_CUSTOM_ELEMENT(i)));
 
@@ -4905,7 +4905,8 @@ static void InitGlobal(void)
   global.convert_leveldir = NULL;
   global.dumplevel_leveldir = NULL;
   global.dumptape_leveldir = NULL;
-  global.create_images_dir = NULL;
+  global.create_sketch_images_dir = NULL;
+  global.create_collect_images_dir = NULL;
 
   global.frames_per_second = 0;
   global.show_frames_per_second = FALSE;
@@ -5189,13 +5190,21 @@ static void Execute_Command(char *command)
 
     program.headless = TRUE;
   }
-  else if (strPrefix(command, "create images "))
+  else if (strPrefix(command, "create sketch images "))
   {
-    global.create_images_dir = getStringCopy(&command[14]);
+    global.create_sketch_images_dir = getStringCopy(&command[21]);
 
-    if (access(global.create_images_dir, W_OK) != 0)
+    if (access(global.create_sketch_images_dir, W_OK) != 0)
       Fail("image target directory '%s' not found or not writable",
-          global.create_images_dir);
+          global.create_sketch_images_dir);
+  }
+  else if (strPrefix(command, "create collect image "))
+  {
+    global.create_collect_images_dir = getStringCopy(&command[21]);
+
+    if (access(global.create_collect_images_dir, W_OK) != 0)
+      Fail("image target directory '%s' not found or not writable",
+          global.create_collect_images_dir);
   }
   else if (strPrefix(command, "create CE image "))
   {
@@ -6188,8 +6197,6 @@ void OpenAll(void)
 
   print_timestamp_time("[init setup/config stuff (1)]");
 
-  InitScoresInfo();
-
   if (options.execute_command)
     Execute_Command(options.execute_command);
 
@@ -6296,11 +6303,16 @@ void OpenAll(void)
     DumpTapes();
     return;
   }
-  else if (global.create_images_dir)
+  else if (global.create_sketch_images_dir)
   {
     CreateLevelSketchImages();
     return;
   }
+  else if (global.create_collect_images_dir)
+  {
+    CreateCollectElementImages();
+    return;
+  }
 
   InitNetworkServer();