From 80b766f13afaa833864ab4fbe6d4f8aa8e41332c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 16 May 2015 11:56:47 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/actors.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ae2dbdd7a..c63c2ccea 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -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; }