- Blood: floatified burnThinkChase

This commit is contained in:
Christoph Oelckers 2022-09-27 08:46:28 +02:00
parent f2f74fc239
commit 3c2239533b

View file

@ -157,10 +157,10 @@ static void burnThinkChase(DBloodActor* actor)
auto target = actor->GetTarget();
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
int nAngle = getangle(dvec);
int nDist = approxDist(dvec);
DAngle nAngle = VecToAngle(dvec);
double nDist = dvec.Length();
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
aiChooseDirection(actor, nAngle);
if (target->xspr.health == 0)
{
switch (actor->spr.type)
@ -192,16 +192,16 @@ static void burnThinkChase(DBloodActor* actor)
return;
}
if (nDist <= pDudeInfo->seeDist)
if (nDist <= pDudeInfo->SeeDist())
{
int nDeltaAngle = getincangle(actor->int_ang(), nAngle);
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
double height = (pDudeInfo->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE;
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))
{
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery())
{
aiSetTarget(actor, actor->GetTarget());
if (nDist < 0x333 && abs(nDeltaAngle) < 85)
if (nDist < 51.1875 && nDeltaAngle < DAngle15)
{
switch (actor->spr.type)
{