mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-20 07:31:00 +00:00
- Exhumed: Get rid of GetAngleToSprite()
in favour of backend utility.
This commit is contained in:
parent
eaa58e6687
commit
e2d3c4dceb
4 changed files with 2 additions and 17 deletions
|
@ -227,7 +227,6 @@ DExhumedActor* FindPlayer(DExhumedActor* nSprite, int nDistance, bool dontengage
|
||||||
DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial = false);
|
DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial = false);
|
||||||
double PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
|
double PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
|
||||||
void CheckSectorFloor(sectortype* pSector, double z, DVector2& xy);
|
void CheckSectorFloor(sectortype* pSector, double z, DVector2& xy);
|
||||||
DAngle GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
|
|
||||||
void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& vel);
|
void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& vel);
|
||||||
Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, DAngle push1);
|
Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, DAngle push1);
|
||||||
void SetQuake(DExhumedActor* nSprite, int nVal);
|
void SetQuake(DExhumedActor* nSprite, int nVal);
|
||||||
|
|
|
@ -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)
|
double PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
|
||||||
{
|
{
|
||||||
if (pActor1 == nullptr || pActor2 == nullptr)
|
if (pActor1 == nullptr || pActor2 == nullptr)
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
||||||
if (nTotalPlayers <= 1)
|
if (nTotalPlayers <= 1)
|
||||||
{
|
{
|
||||||
setForcedSyncInput(nPlayer);
|
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();
|
pPlayerActor->backupang();
|
||||||
|
|
||||||
pPlayer->vel.Zero();
|
pPlayer->vel.Zero();
|
||||||
|
|
|
@ -297,7 +297,7 @@ DExhumedActor* FindSnakeEnemy(int nSnake)
|
||||||
{
|
{
|
||||||
if (pAct2 != pPlayerActor && !(pAct2->spr.cstat & CSTAT_SPRITE_INVISIBLE))
|
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)
|
if (nAngle2 < maxangle)
|
||||||
{
|
{
|
||||||
pEnemy = pAct2;
|
pEnemy = pAct2;
|
||||||
|
|
Loading…
Reference in a new issue