- getangle calls

This commit is contained in:
Christoph Oelckers 2022-08-20 16:20:26 +02:00
parent d5bcc64206
commit 9d5acf8350
7 changed files with 8 additions and 8 deletions

View file

@ -180,7 +180,7 @@ void AIAnubis::Tick(RunListEvent* ev)
{
if (move.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - ap->spr.pos);
int nAngDiff = AngleDiff(ap->int_ang(), nAng);
if (nAngDiff < 64)

View file

@ -310,7 +310,7 @@ void AILavaDude::Tick(RunListEvent* ev)
{
if (coll.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAng) < 64)
{
pActor->nAction = 2;

View file

@ -309,7 +309,7 @@ void AILion::Tick(RunListEvent* ev)
}
else
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAng) < 64)
{
@ -442,7 +442,7 @@ void AILion::Tick(RunListEvent* ev)
{
if (nMov.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAng) < 64)
{
pActor->nAction = 3;

View file

@ -270,7 +270,7 @@ void AIMummy::Tick(RunListEvent* ev)
{
if (nMov.actor() == pTarget)
{
int nAngle = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAngle = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAngle) < 64)
{
pActor->nAction = 2;

View file

@ -245,7 +245,7 @@ void AIScorp::Tick(RunListEvent* ev)
{
if (pTarget == nMov.actor())
{
int nAngle = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAngle = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAngle) < 64)
{
pActor->nAction = 2;

View file

@ -427,7 +427,7 @@ void AISet::Tick(RunListEvent* ev)
{
if (pTarget == nMov.actor())
{
int nAng = getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - pActor->spr.pos);
if (AngleDiff(pActor->int_ang(), nAng) < 64)
{
pActor->nAction = 4;

View file

@ -308,7 +308,7 @@ void AISpider::Tick(RunListEvent* ev)
{
if (nMov.actor() == pTarget)
{
int nAng = getangle(pTarget->int_pos().X - spp->int_pos().X, pTarget->int_pos().Y - spp->int_pos().Y);
int nAng = getangle(pTarget->spr.pos - spp->spr.pos);
if (AngleDiff(spp->int_ang(), nAng) < 64)
{
spp->nAction = 2;