From 0a4d860ec7409f38763ef180cb1b4da87a2d49d4 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 18 Dec 2009 05:38:14 +0000 Subject: [PATCH] - 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) --- docs/rh-log.txt | 3 +++ src/p_mobj.cpp | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 6b6bac33a..5bf1fe581 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ 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 nuts.wad seems the same. diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index b275539b6..0d3ab7ac2 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3358,7 +3358,7 @@ void AActor::Tick () bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) { BYTE lastwaterlevel = waterlevel; - fixed_t fh=FIXED_MIN; + fixed_t fh = FIXED_MIN; bool reset=false; 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; } else { - waterlevel=0; + waterlevel = 0; } } // 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 - if (!(hsec->MoreFlags&SECF_UNDERWATERMASK)) reset=true; + if (!(hsec->MoreFlags&SECF_UNDERWATERMASK)) + { + reset = true; + } } #ifdef _3DFLOORS else @@ -3449,8 +3452,11 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) { P_HitWater(this, Sector, FIXED_MIN, FIXED_MIN, fh, true); } - boomwaterlevel=waterlevel; - if (reset) waterlevel=lastwaterlevel; + boomwaterlevel = waterlevel; + if (reset) + { + waterlevel = lastwaterlevel; + } return false; // we did the splash ourselves }