Skip to content

Commit

Permalink
- Exhumed: Get rid of GetWallNormal() in favour of backend utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Mar 24, 2023
1 parent 9906586 commit eaa58e6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion source/games/exhumed/src/aistuff.h
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions source/games/exhumed/src/grenade.cpp
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/lion.cpp
Expand Up @@ -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;
}
Expand Down
7 changes: 1 addition & 6 deletions source/games/exhumed/src/move.cpp
Expand Up @@ -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();
}

//---------------------------------------------------------------------------
//
//
Expand Down Expand Up @@ -1276,7 +1271,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
}
else if (nVal.type == kHitWall)
{
nAngle = GetWallNormal(nVal.hitWall);
nAngle = nVal.hitWall->normalAngle();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/player.cpp
Expand Up @@ -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!
Expand Down
4 changes: 2 additions & 2 deletions source/games/exhumed/src/queen.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit eaa58e6

Please sign in to comment.