From 8382f12af2a1bdc45b3aaf424ef736cab7f83bdd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Sep 2022 22:41:57 +0200 Subject: [PATCH] - floatified sub_725A4 --- source/games/blood/src/aitchern.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 07154b05f..1c056b506 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -228,20 +228,22 @@ static void sub_725A4(DBloodActor* actor) auto ppos = pPlayer->actor->spr.pos; auto dvect = ppos.XY() - actor->spr.pos; auto pSector = pPlayer->actor->sector(); - int nDist = approxDist(dvect); - if (nDist > pDudeInfo->seeDist && nDist > pDudeInfo->hearDist) + DAngle nAngle = VecToAngle(dvect); + double nDist = dvect.Length(); + + if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->Heardist()) continue; double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - int nDeltaAngle = getincangle(actor->int_ang(), getangle(dvect)); - if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) + DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, pPlayer->actor); aiActivateDude(actor); } - else if (nDist < pDudeInfo->hearDist) + else if (nDist < pDudeInfo->Heardist()) { pDudeExtraE->thinkTime = 0; aiSetTarget(actor, ppos);