mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
Fixes for Door_AnimatedClose (#838)
* Fixes for Door_AnimatedClose - Fixing that Door_AnimatedClose would be activated on an already closed door (playing the sound and the 1st frame of the animation) - There was no check if the Door is already Animated when a tag was used with Door_AnimatedClose * Removed doubled "door->StartClosing();".
This commit is contained in:
parent
cf58666708
commit
29c6782aa1
1 changed files with 15 additions and 0 deletions
|
@ -777,6 +777,9 @@ bool FLevelLocals::EV_SlidingDoor (line_t *line, AActor *actor, int tag, int spe
|
||||||
}
|
}
|
||||||
return false;
|
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));
|
FDoorAnimation *anim = TexMan.FindAnimatedDoor (line->sidedef[0]->GetTexture(side_t::top));
|
||||||
if (anim != NULL)
|
if (anim != NULL)
|
||||||
{
|
{
|
||||||
|
@ -792,8 +795,20 @@ bool FLevelLocals::EV_SlidingDoor (line_t *line, AActor *actor, int tag, int spe
|
||||||
sec = §ors[secnum];
|
sec = §ors[secnum];
|
||||||
if (sec->ceilingdata != NULL)
|
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<DAnimatedDoor *>(sec->ceilingdata);
|
||||||
|
if (door->m_Status == DAnimatedDoor::Waiting)
|
||||||
|
{
|
||||||
|
door->StartClosing();
|
||||||
|
}
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Do not attempt to close the door if it already is
|
||||||
|
else if (type == DAnimatedDoor::adClose)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (auto line : sec->Lines)
|
for (auto line : sec->Lines)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue