Improved Slam functionality:

*Added ONLYSLAMSOLID flag to ignore non-solid Actors that aren't shootable while SKULLFLY is on.
*Added Slam state that gets entered when slamming an Actor.
This commit is contained in:
Boondorl 2022-11-10 16:15:40 -05:00 committed by Christoph Oelckers
commit aea346f1f3
4 changed files with 16 additions and 2 deletions

View file

@ -3140,6 +3140,12 @@ DEFINE_ACTION_FUNCTION(AActor, Howl)
bool AActor::Slam (AActor *thing)
{
if ((flags8 & MF8_ONLYSLAMSOLID)
&& !(thing->flags & MF_SOLID) && !(thing->flags & MF_SHOOTABLE))
{
return true;
}
flags &= ~MF_SKULLFLY;
Vel.Zero();
if (health > 0)
@ -3152,8 +3158,13 @@ bool AActor::Slam (AActor *thing)
// The charging monster may have died by the target's actions here.
if (health > 0)
{
if (SeeState != NULL && !(flags8 & MF8_RETARGETAFTERSLAM)) SetState (SeeState);
else SetIdle();
FState *slam = FindState(NAME_Slam);
if (slam != NULL)
SetState(slam);
else if (SeeState != NULL && !(flags8 & MF8_RETARGETAFTERSLAM))
SetState (SeeState);
else
SetIdle();
}
}
else