- floatified sub_725A4

This commit is contained in:
Christoph Oelckers 2022-09-27 22:41:57 +02:00
parent 2620a8f644
commit 8382f12af2

View file

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