From 64619478fa06aa76307a13043e52fb5323e92521 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Sep 2022 19:56:51 +0200 Subject: [PATCH] - floatified 2 functions in aicaleb.cpp --- source/games/blood/src/aicaleb.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index 5d9dc444e..bf6962c8d 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -94,10 +94,10 @@ static void calebThinkGoto(DBloodActor* actor) auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); - int nAngle = getangle(dvec); + DAngle nAngle = VecToAngle(dvec); double nDist = dvec.Length(); - aiChooseDirection(actor, DAngle::fromBuild(nAngle)); - if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) + aiChooseDirection(actor, nAngle); + if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) { if (pXSector && pXSector->Underwater) aiNewState(actor, &tinycalebSwimSearch); @@ -213,10 +213,10 @@ static void calebThinkSwimGoto(DBloodActor* actor) assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); - int nAngle = getangle(dvec); + DAngle nAngle = VecToAngle(dvec); double nDist = dvec.Length(); - aiChooseDirection(actor, DAngle::fromBuild(nAngle)); - if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery) + aiChooseDirection(actor, nAngle); + if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &tinycalebSwimSearch); aiThinkTarget(actor); }