- added velocity checks when attempting to dive or surface.

This could misbehave at low velocities that could be misinterpreted as a boundary crossing due to the missing check for the movement direction.
This commit is contained in:
Christoph Oelckers 2022-10-17 23:19:57 +02:00
parent 5aa832f536
commit 4f9718e8a8

View file

@ -1936,10 +1936,10 @@ void movetransports_d(void)
{
warpspriteto = 0;
if (ll && sectlotag == 2 && act2->spr.pos.Z < (sectp->ceilingz + ll))
if (ll && sectlotag == 2 && act2->spr.pos.Z < (sectp->ceilingz + ll) && act2->vel.Z < 0)
warpspriteto = 1;
if (ll && sectlotag == 1 && act2->spr.pos.Z > (sectp->floorz - ll))
if (ll && sectlotag == 1 && act2->spr.pos.Z > (sectp->floorz - ll) && act2->vel.Z > 0)
warpspriteto = 1;
if (sectlotag == 0 && (onfloorz || abs(act2->spr.pos.Z - act->spr.pos.Z) < 16))