Fix bounce state not entering when hit from top.

This commit is contained in:
Cacodemon345 2018-08-31 21:11:32 +06:00 committed by Christoph Oelckers
parent f39a389e99
commit eaaf0cb8f6

View file

@ -3649,22 +3649,6 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
mo->Angles.Yaw = angle;
mo->VelFromAngle(speed);
mo->PlayBounceSound(true);
if (mo->BounceFlags & BOUNCE_UseBounceState)
{
FName names[] = { NAME_Bounce, NAME_Actor, NAME_Creature };
FState *bouncestate;
int count = 2;
if ((BlockingMobj->flags & MF_SHOOTABLE) && !(BlockingMobj->flags & MF_NOBLOOD))
{
count = 3;
}
bouncestate = mo->FindState(count, names);
if (bouncestate != NULL)
{
mo->SetState(bouncestate);
}
}
}
else
{
@ -3703,6 +3687,21 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
mo->BounceFlags &= ~BOUNCE_TypeMask;
}
}
if (mo->BounceFlags & BOUNCE_UseBounceState)
{
FName names[] = { NAME_Bounce, NAME_Actor, NAME_Creature };
FState *bouncestate;
int count = 2;
if ((BlockingMobj->flags & MF_SHOOTABLE) && !(BlockingMobj->flags & MF_NOBLOOD))
{
count = 3;
}
bouncestate = mo->FindState(count, names);
if (bouncestate != NULL)
{
mo->SetState(bouncestate);
}
}
return true;
}
return false;