diff --git a/source/games/blood/src/aiinnoc.cpp b/source/games/blood/src/aiinnoc.cpp index 5526689aa..03730b64b 100644 --- a/source/games/blood/src/aiinnoc.cpp +++ b/source/games/blood/src/aiinnoc.cpp @@ -72,9 +72,9 @@ static void innocThinkChase(DBloodActor* actor) auto target = actor->GetTarget(); auto dvec = target->spr.pos.XY() - actor->spr.pos.XY(); - int nAngle = getangle(dvec); - int nDist = approxDist(dvec); - aiChooseDirection(actor, DAngle::fromBuild(nAngle)); + DAngle nAngle = VecToAngle(dvec); + double nDist = dvec.Length(); + aiChooseDirection(actor, nAngle); if (target->xspr.health == 0) { aiNewState(actor, &innocentSearch); @@ -86,16 +86,16 @@ static void innocThinkChase(DBloodActor* actor) return; } - if (nDist <= pDudeInfo->seeDist) + if (nDist <= pDudeInfo->SeeDist()) { - int nDeltaAngle = getincangle(actor->int_ang(), nAngle); + DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE; if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { - if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery) + if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery()) { aiSetTarget(actor, actor->GetTarget()); - if (nDist < 0x666 && abs(nDeltaAngle) < 85) + if (nDist < 102.375 && nDeltaAngle < DAngle15) aiNewState(actor, &innocentIdle); return; }