- some more checking and refactoring of ZatPoint calls.

- removed Plane/Floor/CeilingAtPoint functions because they are overkill for the problem they were meant to solve. Calling ZatPoint with adjusted coordinates created with AActor::PosRelative is just as easy in the few places where this is needed.
- made P_HitWater and P_CheckSplash portal aware.
This commit is contained in:
Christoph Oelckers 2016-02-17 02:21:26 +01:00
commit 0948448988
7 changed files with 35 additions and 84 deletions

View file

@ -440,7 +440,7 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
{
// Falling, not all the way down yet?
sector = player->mo->Sector;
if (player->mo->Z() != sector->floorplane.ZatPoint(player->mo)
if (player->mo->Z() != sector->LowestFloorAt(player->mo)
&& !player->mo->waterlevel)
{
return;
@ -480,7 +480,7 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
}
if (sector->Flags & SECF_DMGTERRAINFX)
{
P_HitWater(player->mo, sector, INT_MIN, INT_MIN, INT_MIN, false, true, true);
P_HitWater(player->mo, player->mo->Sector, INT_MIN, INT_MIN, INT_MIN, false, true, true);
}
}
}
@ -2299,6 +2299,7 @@ void DPusher::Tick ()
continue;
sector_t *hsec = sec->GetHeightSec();
fixedvec2 pos = thing->PosRelative(sec);
if (m_Type == p_wind)
{
if (hsec == NULL)
@ -2316,7 +2317,7 @@ void DPusher::Tick ()
}
else // special water sector
{
ht = hsec->floorplane.ZatPoint(thing);
ht = hsec->floorplane.ZatPoint(pos);
if (thing->Z() > ht) // above ground
{
xspeed = m_Xmag; // full force
@ -2345,7 +2346,7 @@ void DPusher::Tick ()
{ // special water sector
floor = &hsec->floorplane;
}
if (thing->Z() > floor->ZatPoint(thing))
if (thing->Z() > floor->ZatPoint(pos))
{ // above ground
xspeed = yspeed = 0; // no force
}