- floatified 2 functions in aicaleb.cpp

This commit is contained in:
Christoph Oelckers 2022-09-27 19:56:51 +02:00
parent 1c23a2aa32
commit 64619478fa

View file

@ -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);
}