- Used new functionality to avoid moving the puff around in SpawnDeepSplash.

- Fixed: P_RailAttack used the shooting actor or a default puff for some splash
  related actions. It should use the puff type passed to it as a parameter instead.
- Changed splash handling in P_LineAttack to use the actual hit position to
  spawn the splash and not the puff's spawn position which is offset a little.
- made some precision related changes to P_HitWater. The precise hit coordinate
  can now be passed as parameters.


SVN r1350 (trunk)
This commit is contained in:
Christoph Oelckers 2009-01-04 12:25:22 +00:00
commit f7148b6b40
4 changed files with 42 additions and 56 deletions

View file

@ -3058,7 +3058,10 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
// some additional checks to make deep sectors like Boom's splash without setting
// the water flags.
if (boomwaterlevel == 0 && waterlevel != 0 && dosplash) P_HitWater(this, Sector, fh);
if (boomwaterlevel == 0 && waterlevel != 0 && dosplash)
{
P_HitWater(this, Sector, FIXED_MIN, FIXED_MIN, fh, true);
}
boomwaterlevel=waterlevel;
if (reset) waterlevel=lastwaterlevel;
return false; // we did the splash ourselves! ;)
@ -4214,7 +4217,7 @@ int P_GetThingFloorType (AActor *thing)
// Returns true if hit liquid and splashed, false if not.
//---------------------------------------------------------------------------
bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool checkabove)
{
if (thing->flags2 & MF2_FLOATBOB || thing->flags3 & MF3_DONTSPLASH)
return false;
@ -4226,9 +4229,11 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
FSplashDef *splash;
int terrainnum;
if (z==FIXED_MIN) z=thing->z;
if (x == FIXED_MIN) x = thing->x;
if (y == FIXED_MIN) y = thing->y;
if (z == FIXED_MIN) z = thing->z;
// don't splash above the object
else if (z>thing->z+(thing->height>>1)) return false;
if (checkabove && z > thing->z + (thing->height >> 1)) return false;
if (sec->heightsec == NULL ||
//!sec->heightsec->waterzone ||
(sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) ||
@ -4268,14 +4273,14 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
if (smallsplash && splash->SmallSplash)
{
mo = Spawn (splash->SmallSplash, thing->x, thing->y, z, ALLOW_REPLACE);
mo = Spawn (splash->SmallSplash, x, y, z, ALLOW_REPLACE);
if (mo) mo->floorclip += splash->SmallSplashClip;
}
else
{
if (splash->SplashChunk)
{
mo = Spawn (splash->SplashChunk, thing->x, thing->y, z, ALLOW_REPLACE);
mo = Spawn (splash->SplashChunk, x, y, z, ALLOW_REPLACE);
mo->target = thing;
if (splash->ChunkXVelShift != 255)
{
@ -4289,7 +4294,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
}
if (splash->SplashBase)
{
mo = Spawn (splash->SplashBase, thing->x, thing->y, z, ALLOW_REPLACE);
mo = Spawn (splash->SplashBase, x, y, z, ALLOW_REPLACE);
}
if (thing->player && !splash->NoAlert)
{
@ -4304,7 +4309,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t z)
}
else
{
S_Sound (thing->x, thing->y, z, CHAN_ITEM, smallsplash ?
S_Sound (x, y, z, CHAN_ITEM, smallsplash ?
splash->SmallSplashSound : splash->NormalSplashSound,
1, ATTN_IDLE);
}