added options for post delay for door actions
authorHolger Schemel <info@artsoft.org>
Thu, 2 Nov 2017 00:00:23 +0000 (01:00 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:15 +0000 (23:21 +0100)
src/conf_gfx.c
src/main.h
src/tools.c

index 3683400550a710a89abd1b68ba15489a0c2fc886..07525b6feea613fcf56754b7191a37697e701ffa 100644 (file)
@@ -8189,12 +8189,14 @@ struct ConfigInfo image_config[] =
   { "door_1.height",                           "-1"                    },
   { "door_1.step_offset",                      "2"                     },
   { "door_1.step_delay",                       "10"                    },
+  { "door_1.post_delay",                       "100"                   },
   { "door_1.anim_mode",                                "default"               },
 
   { "door_2.width",                            "-1"                    },
   { "door_2.height",                           "-1"                    },
   { "door_2.step_offset",                      "2"                     },
   { "door_2.step_delay",                       "10"                    },
+  { "door_2.post_delay",                       "100"                   },
   { "door_2.anim_mode",                                "default"               },
 
   { "game.panel.level_number.x",               "51"                    },
index f9ffaac88eb05fd1a4231cacdcddab8bdef8a9e0..1c23407daf50d7a7ae0517e8c43c4e3ea73573da 100644 (file)
@@ -2765,6 +2765,7 @@ struct DoorInfo
   int height;
   int step_offset;
   int step_delay;
+  int post_delay;
   int anim_mode;
 };
 
index a16135cc7926f2a03263daa105742adbf6b04fce..b87d7201018950e61db340d14f24b0838e83a7fb 100644 (file)
@@ -5055,6 +5055,17 @@ unsigned int MoveDoor(unsigned int door_state)
       if (door_part_done_all)
        break;
     }
+
+    if (!(door_state & DOOR_NO_DELAY))
+    {
+      /* wait for specified door action post delay */
+      if (door_state & DOOR_ACTION_1 && door_state & DOOR_ACTION_2)
+       Delay(MAX(door_1.post_delay, door_2.post_delay));
+      else if (door_state & DOOR_ACTION_1)
+       Delay(door_1.post_delay);
+      else if (door_state & DOOR_ACTION_2)
+       Delay(door_2.post_delay);
+    }
   }
 
   if (door_state & DOOR_ACTION_1)