mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- floatified cerberusThinkTarget
This commit is contained in:
parent
d3c3363e92
commit
79d17dc645
1 changed files with 6 additions and 6 deletions
|
@ -74,7 +74,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor)
|
|||
void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
int height = pDudeInfo->eyeHeight * actor->spr.yrepeat;
|
||||
int height = pDudeInfo->eyeHeight * actor->spr.yrepeat * REPEAT_SCALE * 0.25;
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
int x = actor->int_pos().X;
|
||||
|
@ -261,20 +261,20 @@ static void cerberusThinkTarget(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)
|
||||
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, VecToAngle(dvect));
|
||||
if (nDist < pDudeInfo->SeeDist() && 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