- re-added and fixed terrain splashes for damaging sectors.

Turned out that P_HitWater wasn't even able to spawn the splashes, even after the call was re-added.
This commit is contained in:
Christoph Oelckers 2016-01-06 16:42:21 +01:00
parent f8b2b4558f
commit eafa394af4
3 changed files with 665 additions and 658 deletions

File diff suppressed because it is too large Load diff

View file

@ -5320,7 +5320,7 @@ int P_GetThingFloorType (AActor *thing)
// Returns true if hit liquid and splashed, false if not. // Returns true if hit liquid and splashed, false if not.
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool checkabove, bool alert) bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool checkabove, bool alert, bool force)
{ {
if (thing->flags3 & MF3_DONTSPLASH) if (thing->flags3 & MF3_DONTSPLASH)
return false; return false;
@ -5362,24 +5362,27 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
} }
#endif #endif
for(unsigned int i=0;i<sec->e->XFloor.ffloors.Size();i++) if (!force)
{ {
F3DFloor * rover = sec->e->XFloor.ffloors[i]; for (unsigned int i = 0; i<sec->e->XFloor.ffloors.Size(); i++)
if (!(rover->flags & FF_EXISTS)) continue;
fixed_t planez = rover->top.plane->ZatPoint(x, y);
if (z > planez - FRACUNIT/2 && z < planez + FRACUNIT/2) // allow minor imprecisions
{ {
if (rover->flags & (FF_SOLID|FF_SWIMMABLE) ) F3DFloor * rover = sec->e->XFloor.ffloors[i];
if (!(rover->flags & FF_EXISTS)) continue;
fixed_t planez = rover->top.plane->ZatPoint(x, y);
if (z > planez - FRACUNIT / 2 && z < planez + FRACUNIT / 2) // allow minor imprecisions
{ {
terrainnum = TerrainTypes[*rover->top.texture]; if (rover->flags & (FF_SOLID | FF_SWIMMABLE))
goto foundone; {
terrainnum = TerrainTypes[*rover->top.texture];
goto foundone;
}
} }
planez = rover->bottom.plane->ZatPoint(x, y);
if (planez < z && !(planez < thing->floorz)) return false;
} }
planez = rover->bottom.plane->ZatPoint(x, y);
if (planez < z && !(planez < thing->floorz)) return false;
} }
hsec = sec->GetHeightSec(); hsec = sec->GetHeightSec();
if (hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES)) if (force || hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES))
{ {
terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)]; terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)];
} }
@ -5403,7 +5406,7 @@ foundone:
// Don't splash for living things with small vertical velocities. // Don't splash for living things with small vertical velocities.
// There are levels where the constant splashing from the monsters gets extremely annoying // There are levels where the constant splashing from the monsters gets extremely annoying
if ((thing->flags3&MF3_ISMONSTER || thing->player) && thing->velz >= -6*FRACUNIT) if (((thing->flags3&MF3_ISMONSTER || thing->player) && thing->velz >= -6*FRACUNIT) && !force)
return Terrains[terrainnum].IsLiquid; return Terrains[terrainnum].IsLiquid;
splash = &Splashes[splashnum]; splash = &Splashes[splashnum];

View file

@ -468,6 +468,10 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
{ {
G_ExitLevel(0, false); G_ExitLevel(0, false);
} }
if (sector->Flags & SECF_DMGTERRAINFX)
{
P_HitWater(player->mo, sector, INT_MIN, INT_MIN, INT_MIN, false, true, true);
}
} }
} }
} }