X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=b87d7201018950e61db340d14f24b0838e83a7fb;hp=6b817e85cf59cdbc8e012ea189b6c6c1249f8e19;hb=c80e8f65b8f026f8b06673f06cea31cc2667351f;hpb=45e0606e403584e46cd3c005d488cc274db8e871 diff --git a/src/tools.c b/src/tools.c index 6b817e85..b87d7201 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4862,9 +4862,23 @@ unsigned int MoveDoor(unsigned int door_state) { /* opening door sound has priority over simultaneously closing door */ if (door_state & (DOOR_OPEN_1 | DOOR_OPEN_2)) + { PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE); + + if (door_state & DOOR_OPEN_1) + PlayMenuSoundStereo(SND_DOOR_1_OPENING, SOUND_MIDDLE); + if (door_state & DOOR_OPEN_2) + PlayMenuSoundStereo(SND_DOOR_2_OPENING, SOUND_MIDDLE); + } else if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2)) + { PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE); + + if (door_state & DOOR_CLOSE_1) + PlayMenuSoundStereo(SND_DOOR_1_CLOSING, SOUND_MIDDLE); + if (door_state & DOOR_CLOSE_2) + PlayMenuSoundStereo(SND_DOOR_2_CLOSING, SOUND_MIDDLE); + } } for (k = start; k < num_move_steps; k++) @@ -5041,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)