mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- restored the old underwater sinking code for players.
SVN r3684 (trunk)
This commit is contained in:
parent
ba9f29531e
commit
e094e1b515
1 changed files with 45 additions and 25 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue