- added 'damageonland' property to terrain definition

This property helps to replicate vanilla Hexen behavior of damaging player right after touching lava floor

https://forum.zdoom.org/viewtopic.php?t=66512
This commit is contained in:
alexey.lysiuk 2019-11-29 15:49:45 +02:00 committed by Christoph Oelckers
commit 1a19dbb52f
5 changed files with 13 additions and 0 deletions

View file

@ -6043,6 +6043,13 @@ foundone:
if (splashnum == -1)
return Terrains[terrainnum].IsLiquid;
const bool dealDamageOnLand = thing->player
&& Terrains[terrainnum].DamageOnLand
&& Terrains[terrainnum].DamageAmount
&& (thing->Level->time & Terrains[terrainnum].DamageTimeMask);
if (dealDamageOnLand)
P_DamageMobj(thing, nullptr, nullptr, Terrains[terrainnum].DamageAmount, Terrains[terrainnum].DamageMOD);
// don't splash when touching an underwater floor
if (thing->waterlevel >= 1 && pos.Z <= thing->floorz) return Terrains[terrainnum].IsLiquid;