diff --git a/src/g_shared/a_doors.cpp b/src/g_shared/a_doors.cpp index c3c8b92e86..664b0096ee 100644 --- a/src/g_shared/a_doors.cpp +++ b/src/g_shared/a_doors.cpp @@ -777,6 +777,9 @@ bool FLevelLocals::EV_SlidingDoor (line_t *line, AActor *actor, int tag, int spe } return false; } + // Do not attempt to close the door if it already is + else if (type == DAnimatedDoor::adClose) + return false; FDoorAnimation *anim = TexMan.FindAnimatedDoor (line->sidedef[0]->GetTexture(side_t::top)); if (anim != NULL) { @@ -792,8 +795,20 @@ bool FLevelLocals::EV_SlidingDoor (line_t *line, AActor *actor, int tag, int spe sec = §ors[secnum]; if (sec->ceilingdata != NULL) { + // Check if the animated door is already open and waiting, if so, close it. + if (sec->ceilingdata->IsA (RUNTIME_CLASS(DAnimatedDoor))) + { + DAnimatedDoor *door = barrier_cast(sec->ceilingdata); + if (door->m_Status == DAnimatedDoor::Waiting) + { + door->StartClosing(); + } + } continue; } + // Do not attempt to close the door if it already is + else if (type == DAnimatedDoor::adClose) + continue; for (auto line : sec->Lines) {