From 06ee21c51df2b2dd154c5e5e6a7ed8864dca84be Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson <18584402+madame-rachelle@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:37:48 -0400 Subject: [PATCH] - allow notification of actor goal is reached inside of a SECF_NOATTACK sector --- src/playsim/p_enemy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/playsim/p_enemy.cpp b/src/playsim/p_enemy.cpp index d4e8e77de..bb929f270 100644 --- a/src/playsim/p_enemy.cpp +++ b/src/playsim/p_enemy.cpp @@ -269,9 +269,6 @@ int P_CheckMeleeRange (AActor* actor, double range) double dist; - if (!pl || (actor->Sector->Flags & SECF_NOATTACK)) - return false; - dist = actor->Distance2D (pl); if (range < 0) range = actor->meleerange; @@ -282,6 +279,9 @@ int P_CheckMeleeRange (AActor* actor, double range) if (pl == actor->goal) return true; + if (!pl || (actor->Sector->Flags & SECF_NOATTACK)) + return false; + // [RH] Don't melee things too far above or below actor. if (!(actor->flags5 & MF5_NOVERTICALMELEERANGE)) {