mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- floatified 2 functions in aicaleb.cpp
This commit is contained in:
parent
1c23a2aa32
commit
64619478fa
1 changed files with 6 additions and 6 deletions
|
@ -94,10 +94,10 @@ static void calebThinkGoto(DBloodActor* actor)
|
||||||
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
||||||
|
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
int nAngle = getangle(dvec);
|
DAngle nAngle = VecToAngle(dvec);
|
||||||
double nDist = dvec.Length();
|
double nDist = dvec.Length();
|
||||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
aiChooseDirection(actor, nAngle);
|
||||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||||
{
|
{
|
||||||
if (pXSector && pXSector->Underwater)
|
if (pXSector && pXSector->Underwater)
|
||||||
aiNewState(actor, &tinycalebSwimSearch);
|
aiNewState(actor, &tinycalebSwimSearch);
|
||||||
|
@ -213,10 +213,10 @@ static void calebThinkSwimGoto(DBloodActor* actor)
|
||||||
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
|
||||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||||
int nAngle = getangle(dvec);
|
DAngle nAngle = VecToAngle(dvec);
|
||||||
double nDist = dvec.Length();
|
double nDist = dvec.Length();
|
||||||
aiChooseDirection(actor, DAngle::fromBuild(nAngle));
|
aiChooseDirection(actor, nAngle);
|
||||||
if (nDist < 32 && abs(actor->int_ang() - nAngle) < pDudeInfo->periphery)
|
if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery())
|
||||||
aiNewState(actor, &tinycalebSwimSearch);
|
aiNewState(actor, &tinycalebSwimSearch);
|
||||||
aiThinkTarget(actor);
|
aiThinkTarget(actor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue