- fix bug with 06ee21c51d - if (!pl) should always return false

This commit is contained in:
inkoalawetrust 2022-09-03 19:04:58 -04:00 committed by Rachael Alexanderson
parent ca6a2152b9
commit 664ccf8a7c
1 changed files with 5 additions and 2 deletions

View File

@ -268,7 +268,10 @@ int P_CheckMeleeRange (AActor* actor, double range)
AActor *pl = actor->target;
double dist;
if (!pl)
return false;
dist = actor->Distance2D (pl);
if (range < 0) range = actor->meleerange;
@ -279,7 +282,7 @@ int P_CheckMeleeRange (AActor* actor, double range)
if (pl == actor->goal)
return true;
if (!pl || (actor->Sector->Flags & SECF_NOATTACK))
if (actor->Sector->Flags & SECF_NOATTACK)
return false;
// [RH] Don't melee things too far above or below actor.