Added SECMF_HURTMONSTERS, SECMF_HARMINAIR and NOSECTORDAMAGE.

- Added SECMF_HURTMONSTERS, which allows monsters in the flagged sector to be hurt with the same behavior as players (i.e damage leaking).
- Added SECMF_HARMINAIR, which allows players (And monsters with SECMF_HURTMONSTERS) to be hurt when they're inside the sector in general, instead of only when they're walking on it. Replicates the behavior of the DAMAGE_IN_AIR flag that SectorDamage() uses.
- Added NOSECTORDAMAGE, which makes actors with the flag immune to any harmful floors.
This commit is contained in:
inkoalawetrust 2024-03-29 20:55:50 +02:00 committed by Rachael Alexanderson
commit 391f496512
13 changed files with 76 additions and 57 deletions

View file

@ -4431,6 +4431,14 @@ void AActor::Tick ()
// must have been removed
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) && (player || (player == nullptr && Sector->MoreFlags & SECMF_HURTMONSTERS)))
{
P_ActorOnSpecial3DFloor(this);
P_ActorInSpecialSector(this,Sector);
if (!isAbove(Sector->floorplane.ZatPoint(this)) || waterlevel) // Actor must be touching the floor for TERRAIN flats.
P_ActorOnSpecialFlat(this, P_GetThingFloorType(this));
}
if (tics != -1)
{