mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- floatified aiPodChase
This commit is contained in:
parent
6b6ab4e81e
commit
9586a2f16d
1 changed files with 7 additions and 7 deletions
|
@ -182,9 +182,9 @@ static void aiPodChase(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) {
|
||||
|
||||
switch (actor->spr.type) {
|
||||
|
@ -199,16 +199,16 @@ static void aiPodChase(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() && abs(nDeltaAngle) <= pDudeInfo->Periphery())
|
||||
{
|
||||
aiSetTarget(actor, actor->GetTarget());
|
||||
if (abs(nDeltaAngle) < 85 && target->spr.type != kDudePodGreen && target->spr.type != kDudePodFire) {
|
||||
if (nDeltaAngle < DAngle15 && target->spr.type != kDudePodGreen && target->spr.type != kDudePodFire) {
|
||||
switch (actor->spr.type) {
|
||||
case kDudePodGreen:
|
||||
case kDudePodFire:
|
||||
|
|
Loading…
Reference in a new issue