- simplify and deconstruct logic for applying sector damage - also fixes voodoo doll sector damage in TNT MAP30

This commit is contained in:
Rachael Alexanderson 2024-10-14 03:39:26 -04:00
parent 0785038120
commit 2f30f720a4
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0

View file

@ -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);