- Exhumed: Get rid of GetAngleToSprite() in favour of backend utility.

This commit is contained in:
Mitchell Richters 2023-03-24 17:12:19 +11:00
parent eaa58e6687
commit e2d3c4dceb
4 changed files with 2 additions and 17 deletions

View file

@ -227,7 +227,6 @@ DExhumedActor* FindPlayer(DExhumedActor* nSprite, int nDistance, bool dontengage
DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial = false);
double PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
void CheckSectorFloor(sectortype* pSector, double z, DVector2& xy);
DAngle GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& vel);
Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, DAngle push1);
void SetQuake(DExhumedActor* nSprite, int nVal);

View file

@ -585,20 +585,6 @@ Collision MoveCreatureWithCaution(DExhumedActor* pActor)
//
//---------------------------------------------------------------------------
DAngle GetAngleToSprite(DExhumedActor* a1, DExhumedActor* a2)
{
if (!a1 || !a2)
return -minAngle;
return (a2->spr.pos - a1->spr.pos).Angle();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
double PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
{
if (pActor1 == nullptr || pActor2 == nullptr)

View file

@ -1265,7 +1265,7 @@ void AIPlayer::Tick(RunListEvent* ev)
if (nTotalPlayers <= 1)
{
setForcedSyncInput(nPlayer);
pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle);
pPlayerActor->spr.Angles = DRotator(nullAngle, (pSpiritSprite->spr.pos.XY() - pPlayerActor->spr.pos.XY()).Angle(), nullAngle);
pPlayerActor->backupang();
pPlayer->vel.Zero();

View file

@ -297,7 +297,7 @@ DExhumedActor* FindSnakeEnemy(int nSnake)
{
if (pAct2 != pPlayerActor && !(pAct2->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
DAngle nAngle2 = absangle(nAngle, GetAngleToSprite(pActor, pAct2));
DAngle nAngle2 = absangle(nAngle, (pAct2->spr.pos.XY() - pActor->spr.pos.XY()).Angle());
if (nAngle2 < maxangle)
{
pEnemy = pAct2;