remaining floatification on aiLookForTarget

This commit is contained in:
Christoph Oelckers 2022-09-26 23:26:46 +02:00
parent fafb4cfc29
commit 48cadbd392

View file

@ -1547,20 +1547,20 @@ void aiLookForTarget(DBloodActor* actor)
auto dvec = ppos - actor->spr.pos.XY();
auto pSector = pPlayer->actor->sector();
int nDist = approxDist(dvec);
if (nDist > pDudeInfo->seeDist && nDist > pDudeInfo->hearDist)
double nDist = dvec.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(dvec));
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
DAngle nDeltaAngle = absangle(actor->spr.angle, VecToAngle(dvec));
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
{
aiSetTarget(actor, pPlayer->actor);
aiActivateDude(actor);
return;
}
else if (nDist < pDudeInfo->hearDist)
else if (nDist < pDudeInfo->Heardist())
{
aiSetTarget(actor, ppos);
aiActivateDude(actor);