From ec48b9173056359bad2d7ef4772a276f1b97c848 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Nov 2022 10:21:47 +0100 Subject: [PATCH] - fixed the last remaining z/inttoworld mismatches. The one in clipmove was critical, the other ones not so much. --- source/build/src/clip.cpp | 2 +- source/games/sw/src/sprite.cpp | 4 ++-- source/games/sw/src/weapon.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 4b46208d6..fcba3addb 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -603,7 +603,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if (enginecompatibility_mode != ENGINECOMPATIBILITY_NONE) { - DVector3 fpos(pos->X* inttoworld, pos->Y* inttoworld, pos->Z* inttoworld); + DVector3 fpos(pos->X* inttoworld, pos->Y* inttoworld, pos->Z* zinttoworld); for (int j=0; jspr.pos.plusZ(-zH - maptoworld); + auto pos = actor->spr.pos.plusZ(-zH - zmaptoworld); FAFgetzrange(pos, actor->sector(), &globhiz, &globhihit, &globloz, &globlohit, actor->clipdist - GETZRANGE_CLIP_ADJ, cliptype); @@ -6544,7 +6544,7 @@ int MissileZrange(DSWActor* actor) auto tempshort = actor->spr.cstat; actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); - FAFgetzrangepoint(actor->spr.pos.plusZ(-maptoworld), actor->sector(), &globhiz, &globhihit, &globloz, &globlohit); + FAFgetzrangepoint(actor->spr.pos.plusZ(-zmaptoworld), actor->sector(), &globhiz, &globhihit, &globloz, &globlohit); actor->spr.cstat = tempshort; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 16140f71a..ccf5ab6fa 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -14981,7 +14981,7 @@ int InitCoolgFire(DSWActor* actor) int DoCoolgDrip(DSWActor* actor) { actor->user.Counter += 220; - actor->spr.pos.Z += actor->user.Counter * maptoworld; + actor->spr.pos.Z += actor->user.Counter * zmaptoworld; if (actor->spr.pos.Z > actor->user.loz - actor->user.floor_dist) {