mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- floatified sub_725A4
This commit is contained in:
parent
2620a8f644
commit
8382f12af2
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue