mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Blood: floatified calebThinkSwimChase
This commit is contained in:
parent
c85a95ca03
commit
c1da02de8a
1 changed files with 9 additions and 9 deletions
|
@ -236,9 +236,10 @@ static void calebThinkSwimChase(DBloodActor* actor)
|
|||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
int nAngle = getangle(dvec);
|
||||
int nDist = approxDist(dvec);
|
||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
||||
DAngle nAngle = VecToAngle(dvec);
|
||||
double nDist = dvec.Length();
|
||||
aiChooseDirection(actor, nAngle);
|
||||
|
||||
if (target->xspr.health == 0)
|
||||
{
|
||||
aiNewState(actor, &tinycalebSwimSearch);
|
||||
|
@ -250,18 +251,17 @@ static void calebThinkSwimChase(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;
|
||||
int top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
|
||||
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 < 0x400 && abs(nDeltaAngle) < 85)
|
||||
if (nDist < 0x40 && abs(nDeltaAngle) < DAngle15)
|
||||
aiNewState(actor, &tinycalebSwimAttack);
|
||||
else
|
||||
aiNewState(actor, &tinycaleb13967C);
|
||||
|
|
Loading…
Reference in a new issue