From 32071c4460bdfbd181d786099fb1ede176174cf5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 Dec 2022 18:42:55 +0100 Subject: [PATCH] - Blood: fixed 3 places where 3D distance was used but 2D should have been used. --- source/games/blood/src/ai.cpp | 4 ++-- source/games/blood/src/aibat.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index e0a05a99c..90888ff8e 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -1495,7 +1495,7 @@ void aiThinkTarget(DBloodActor* actor) if (actor->GetOwner() == pPlayer->actor || pPlayer->actor->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; auto ppos = pPlayer->actor->spr.pos; - auto dvec = ppos - actor->spr.pos.XY(); + auto dvec = ppos.XY() - actor->spr.pos.XY(); auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length(); @@ -1540,7 +1540,7 @@ void aiLookForTarget(DBloodActor* actor) if (actor->GetOwner() == pPlayer->actor || pPlayer->actor->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; auto ppos = pPlayer->actor->spr.pos; - auto dvec = ppos - actor->spr.pos.XY(); + auto dvec = ppos.XY() - actor->spr.pos.XY(); auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length(); diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index 86f2415a8..b1579d9a6 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -98,7 +98,7 @@ static void batThinkTarget(DBloodActor* actor) if (pPlayer->actor->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; auto ppos = pPlayer->actor->spr.pos; - auto dvec = ppos - actor->spr.pos.XY(); + auto dvec = ppos.XY() - actor->spr.pos.XY(); auto pSector = pPlayer->actor->sector(); double nDist = dvec.Length();