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