- restored the old underwater sinking code for players.

SVN r3684 (trunk)
This commit is contained in:
Christoph Oelckers 2012-06-09 18:54:53 +00:00
parent ba9f29531e
commit e094e1b515

View file

@ -2199,7 +2199,9 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
mo->velz -= grav; mo->velz -= grav;
} }
} }
if (mo->waterlevel > 1 || (mo->waterlevel == 1 && mo->player == NULL)) if (mo->player == NULL)
{
if (mo->waterlevel >= 1)
{ {
fixed_t sinkspeed; fixed_t sinkspeed;
@ -2236,6 +2238,24 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
} }
} }
} }
else
{
if (mo->waterlevel > 1)
{
fixed_t sinkspeed = -WATER_SINK_SPEED;
if (mo->velz < sinkspeed)
{
mo->velz = (startvelz < sinkspeed) ? startvelz : sinkspeed;
}
else
{
mo->velz = startvelz + ((mo->velz - startvelz) >>
(mo->waterlevel == 1 ? WATER_SINK_SMALL_FACTOR : WATER_SINK_FACTOR));
}
}
}
}
if (mo->flags2 & MF2_FLOATBOB) if (mo->flags2 & MF2_FLOATBOB)
{ {