- Fixed: Using Transfer_Heights with the SECF_UNDERWATER and

SECF_FAKEFLOORONLY flags applied the water effect to the ceiling and not
  just the floor.


SVN r2030 (trunk)
This commit is contained in:
Randy Heit 2009-12-18 05:38:14 +00:00
parent 0e3c1dc33e
commit 0a4d860ec7
2 changed files with 15 additions and 6 deletions

View file

@ -1,4 +1,7 @@
December 17, 2009 December 17, 2009
- Fixed: Using Transfer_Heights with the SECF_UNDERWATER and
SECF_FAKEFLOORONLY flags applied the water effect to the ceiling and not
just the floor.
- Replaced sprite sorting with a stable sort. Performance at the start of - Replaced sprite sorting with a stable sort. Performance at the start of
nuts.wad seems the same. nuts.wad seems the same.

View file

@ -3358,7 +3358,7 @@ void AActor::Tick ()
bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
{ {
BYTE lastwaterlevel = waterlevel; BYTE lastwaterlevel = waterlevel;
fixed_t fh=FIXED_MIN; fixed_t fh = FIXED_MIN;
bool reset=false; bool reset=false;
waterlevel = 0; waterlevel = 0;
@ -3393,18 +3393,21 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
} }
} }
} }
else if (z + height > hsec->ceilingplane.ZatPoint (x, y)) else if (!(hsec->MoreFlags & SECF_FAKEFLOORONLY) && (z + height > hsec->ceilingplane.ZatPoint (x, y)))
{ {
waterlevel = 3; waterlevel = 3;
} }
else else
{ {
waterlevel=0; waterlevel = 0;
} }
} }
// even non-swimmable deep water must be checked here to do the splashes correctly // even non-swimmable deep water must be checked here to do the splashes correctly
// But the water level must be reset when this function returns // But the water level must be reset when this function returns
if (!(hsec->MoreFlags&SECF_UNDERWATERMASK)) reset=true; if (!(hsec->MoreFlags&SECF_UNDERWATERMASK))
{
reset = true;
}
} }
#ifdef _3DFLOORS #ifdef _3DFLOORS
else else
@ -3449,8 +3452,11 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
{ {
P_HitWater(this, Sector, FIXED_MIN, FIXED_MIN, fh, true); P_HitWater(this, Sector, FIXED_MIN, FIXED_MIN, fh, true);
} }
boomwaterlevel=waterlevel; boomwaterlevel = waterlevel;
if (reset) waterlevel=lastwaterlevel; if (reset)
{
waterlevel = lastwaterlevel;
}
return false; // we did the splash ourselves return false; // we did the splash ourselves
} }