- floatified cerberusThinkTarget

This commit is contained in:
Christoph Oelckers 2022-09-27 09:01:18 +02:00
parent d3c3363e92
commit 79d17dc645

View file

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