From 2f30f720a4471ebcf4e9a5a8d5b9f1ff4450466b Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 14 Oct 2024 03:39:26 -0400 Subject: [PATCH] - simplify and deconstruct logic for applying sector damage - also fixes voodoo doll sector damage in TNT MAP30 --- src/playsim/p_mobj.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 5dff4a0be0..32f650ca50 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -4436,7 +4436,11 @@ void AActor::Tick () if (ObjectFlags & OF_EuthanizeMe) return; } //[inkoalawetrust] Genericized level damage handling that makes sector, 3D floor, and TERRAIN flat damage affect monsters and other NPCs too. - if ((!(flags9 & MF9_NOSECTORDAMAGE) || flags9 & MF9_FORCESECTORDAMAGE) && (player || (player == nullptr && (Sector->MoreFlags & SECMF_HURTMONSTERS || flags9 & MF9_FORCESECTORDAMAGE)))) + bool afsdnope = !!(flags9 & MF9_NOSECTORDAMAGE); + bool afsdforce = !!(flags9 & MF9_FORCESECTORDAMAGE); + bool sfhurtmonsters = !!(Sector->MoreFlags & SECMF_HURTMONSTERS); + bool isplayer = (player != nullptr) && (this == player->mo); + if ((!afsdnope || afsdforce) && (isplayer || sfhurtmonsters || afsdforce)) { P_ActorOnSpecial3DFloor(this); P_ActorInSpecialSector(this,Sector);