When checking for SE7 water teleportation, regard sign of z velocity.

This fixes RPGs fired upwards at a steep angle teleporting immediately
to underwater when wading in water (reported via PM by Turok 64 Jr).

git-svn-id: https://svn.eduke32.com/eduke32@5190 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-05-16 11:56:47 +00:00
parent a979fa95a3
commit 80b766f13a

View file

@ -3461,14 +3461,15 @@ ACTOR_STATIC void G_MoveTransports(void)
{
if (totalclock > actor[j].lasttransport)
{
const int32_t ll = klabs(sprite[j].zvel);
const int32_t zvel = sprite[j].zvel;
const int32_t ll = klabs(zvel);
int32_t warpspriteto = 0;
if (ll != 0)
{
if (sectlotag == ST_2_UNDERWATER && sprite[j].z < (sector[sect].ceilingz+ll))
if (sectlotag == ST_2_UNDERWATER && sprite[j].z < (sector[sect].ceilingz+ll) && zvel < 0)
warpspriteto = 1;
if (sectlotag == ST_1_ABOVE_WATER && sprite[j].z > (sector[sect].floorz-ll))
if (sectlotag == ST_1_ABOVE_WATER && sprite[j].z > (sector[sect].floorz-ll) && zvel > 0)
warpspriteto = 1;
}