From 3e33e31d1961f366229d5b4848fa29d2d797b8c3 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 275de6fe5ca..4aa95ae83ee 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);