From 81268cb9b66a0a8247fb2e5ebd88baa4578f64dd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 2 Dec 2021 23:32:20 +0100 Subject: [PATCH] partial Revert of "- optimized vector math." This reverts commit 826fd7ddb27a7858cfe08ce689b03d632556f300. Looks like there's dependencies on the intermediate variables. The optimized code gave the same result but did not work anymore. --- source/games/blood/src/gameutil.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 56d962b7b..f6e8c0415 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -589,7 +589,10 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (!actor) return 2; auto link = actor->GetOwner(); gHitInfo.clearObj(); - vec3_t pos = link->s().pos - actor->s().pos + vec3_t(gHitInfo.hitx, gHitInfo.hity, gHitInfo.hitz); + x1 = gHitInfo.hitx + link->s().x - actor->s().x; + y1 = gHitInfo.hity + link->s().y - actor->s().y; + z1 = gHitInfo.hitz + link->s().z - actor->s().z; + pos = { x1, y1, z1 }; hitData.pos.z = gHitInfo.hitz; hitscan(&pos, link->s().sectnum, dx, dy, dz<<4, &hitData, CLIPMASK1); gHitInfo.set(&hitData); @@ -601,7 +604,10 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (!actor) return 1; auto link = actor->GetOwner(); gHitInfo.clearObj(); - vec3_t pos = link->s().pos - actor->s().pos + vec3_t(gHitInfo.hitx, gHitInfo.hity, gHitInfo.hitz); + x1 = gHitInfo.hitx + link->s().x - actor->s().x; + y1 = gHitInfo.hity + link->s().y - actor->s().y; + z1 = gHitInfo.hitz + link->s().z - actor->s().z; + pos = { x1, y1, z1 }; hitData.pos.z = gHitInfo.hitz; hitscan(&pos, link->s().sectnum, dx, dy, dz<<4, &hitData, CLIPMASK1); gHitInfo.set(&hitData);