- 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

View file

@ -508,7 +508,7 @@ void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch);
void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version
void P_TraceBleed (int damage, AActor *target); // random direction version void P_TraceBleed (int damage, AActor *target); // random direction version
bool P_HitFloor (AActor *thing); bool P_HitFloor (AActor *thing);
bool P_HitWater (AActor *thing, sector_t *sec, fixed_t splashx = FIXED_MIN, fixed_t splashy = FIXED_MIN, fixed_t splashz=FIXED_MIN, bool checkabove = false, bool alert = true); bool P_HitWater (AActor *thing, sector_t *sec, fixed_t splashx = FIXED_MIN, fixed_t splashy = FIXED_MIN, fixed_t splashz=FIXED_MIN, bool checkabove = false, bool alert = true, bool force = false);
void P_CheckSplash(AActor *self, fixed_t distance); void P_CheckSplash(AActor *self, fixed_t distance);
void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z = 0, int color1 = 0, int color2 = 0, double maxdiff = 0, int flags = 0, const PClass *puff = NULL, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, int duration = 0, double sparsity = 1.0, double drift = 1.0, const PClass *spawnclass = NULL, int SpiralOffset = 270); // [RH] Shoot a railgun void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z = 0, int color1 = 0, int color2 = 0, double maxdiff = 0, int flags = 0, const PClass *puff = NULL, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, int duration = 0, double sparsity = 1.0, double drift = 1.0, const PClass *spawnclass = NULL, int SpiralOffset = 270); // [RH] Shoot a railgun

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,6 +5362,8 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
} }
#endif #endif
if (!force)
{
for (unsigned int i = 0; i<sec->e->XFloor.ffloors.Size(); i++) for (unsigned int i = 0; i<sec->e->XFloor.ffloors.Size(); i++)
{ {
F3DFloor * rover = sec->e->XFloor.ffloors[i]; F3DFloor * rover = sec->e->XFloor.ffloors[i];
@ -5378,8 +5380,9 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
planez = rover->bottom.plane->ZatPoint(x, y); planez = rover->bottom.plane->ZatPoint(x, y);
if (planez < z && !(planez < thing->floorz)) return false; 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);
}
} }
} }
} }