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

This commit is contained in:
Mitchell Richters 2023-03-24 17:09:40 +11:00
parent 9906586569
commit eaa58e6687
6 changed files with 7 additions and 13 deletions

View file

@ -228,7 +228,6 @@ DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial =
double PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
void CheckSectorFloor(sectortype* pSector, double z, DVector2& xy);
DAngle GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
DAngle GetWallNormal(walltype* nWall);
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

@ -96,7 +96,7 @@ void ThrowGrenade(int nPlayer, double dz, double push1)
auto nMov = movesprite(pActor, vec, dz, 0, CLIPMASK1);
if (nMov.type == kHitWall)
{
nAngle = GetWallNormal(nMov.hitWall);
nAngle = nMov.hitWall->normalAngle();
BounceGrenade(pActor, nAngle);
}
}
@ -359,7 +359,7 @@ void AIGrenade::Tick(RunListEvent* ev)
// loc_2CF60:
if (nMov.type == kHitWall)
{
BounceGrenade(pActor, GetWallNormal(nMov.hitWall));
BounceGrenade(pActor, nMov.hitWall->normalAngle());
}
else if (nMov.type == kHitSprite)
{

View file

@ -418,7 +418,7 @@ void AILion::Tick(RunListEvent* ev)
if (nMov.type == kHitWall)
{
pActor->nAction = 7;
pActor->spr.Angles.Yaw = (GetWallNormal(nMov.hitWall) + DAngle180).Normalized360();
pActor->spr.Angles.Yaw = (nMov.hitWall->normalAngle() + DAngle180).Normalized360();
pActor->nCount = RandomSize(4);
return;
}

View file

@ -1025,11 +1025,6 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
return movesprite(pActor, vec, zz * 16 + BobVal(zbob) * 2, 0, nClipType);
}
DAngle GetWallNormal(walltype* pWall)
{
return (pWall->delta().Angle() + DAngle90).Normalized360();
}
//---------------------------------------------------------------------------
//
//
@ -1276,7 +1271,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
}
else if (nVal.type == kHitWall)
{
nAngle = GetWallNormal(nVal.hitWall);
nAngle = nVal.hitWall->normalAngle();
}
else
{

View file

@ -770,7 +770,7 @@ static void CheckMovingBlocks(Player* const pPlayer, Collision& nMove, DVector3&
else //if (nMove.type == kHitWall)
{
sect = nMove.hitWall->nextSector();
nNormal = GetWallNormal(nMove.hitWall);
nNormal = nMove.hitWall->normalAngle();
}
// moving blocks - move this to a separate function!

View file

@ -601,7 +601,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
default:
return;
case kHitWall:
nAngle = GetWallNormal(nMov.hitWall);
nAngle = nMov.hitWall->normalAngle();
break;
case kHitSprite:
nAngle = nMov.actor()->spr.Angles.Yaw;
@ -856,7 +856,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
if (nMov.exbits == 0)
{
if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.Angles.Yaw;
else if (nMov.type == kHitWall) nNewAng = GetWallNormal(nMov.hitWall);
else if (nMov.type == kHitWall) nNewAng = nMov.hitWall->normalAngle();
}
else if (nMov.exbits == kHitAux2)
{