diff --git a/source/build/include/build.h b/source/build/include/build.h index 503531c38..73080df80 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -152,7 +152,6 @@ extern TArray wall; extern spritetype sprite[MAXSPRITES]; EXTERN int leveltimer; - extern TArray sectorbackup; extern TArray wallbackup; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index fcea482cd..6c71e99b4 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -5785,7 +5785,7 @@ static void actCheckThings() speed = pXSector->panVel << 9; if (!pXSector->panAlways && pXSector->busy) speed = MulScale(speed, pXSector->busy, 16); } - if (pSector->floorstat & 64) angle = (angle + GetWallAngle(pSector->wallptr) + 512) & 2047; + if (pSector->floorstat & 64) angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047; actor->xvel += MulScale(speed, Cos(angle), 30); actor->yvel += MulScale(speed, Sin(angle), 30); @@ -6235,7 +6235,7 @@ static void actCheckDudes() speed = MulScale(speed, pXSector->busy, 16); } if (pSector->floorstat & 64) - angle = (angle + GetWallAngle(pSector->wallptr) + 512) & 2047; + angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047; int dx = MulScale(speed, Cos(angle), 30); int dy = MulScale(speed, Sin(angle), 30); actor->xvel += dx; @@ -6910,7 +6910,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0); if (pFX) { - pFX->s().ang = (GetWallAngle(nWall) + 512) & 2047; + pFX->s().ang = (GetWallAngle(pWall) + 512) & 2047; pFX->s().cstat |= 16; } } @@ -7017,7 +7017,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, if (pFX) { pFX->zvel = 0x2222; - pFX->s().ang = (GetWallAngle(nWall) + 512) & 2047; + pFX->s().ang = (GetWallAngle(&wall[nWall]) + 512) & 2047; pFX->s().cstat |= 16; } } diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 98aac4e26..3c237ccb8 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -284,12 +284,6 @@ bool CheckProximityWall(int nWall, int x, int y, int nDist) return check1 * check1 < check2 * nDist * nDist; } -int GetWallAngle(int nWall) -{ - int nWall2 = wall[nWall].point2; - return getangle(wall[nWall2].x - wall[nWall].x, wall[nWall2].y - wall[nWall].y); -} - int GetWallAngle(walltype* pWall) { int nWall2 = pWall->point2; diff --git a/source/games/blood/src/gameutil.h b/source/games/blood/src/gameutil.h index 42c551823..407c5d609 100644 --- a/source/games/blood/src/gameutil.h +++ b/source/games/blood/src/gameutil.h @@ -56,7 +56,6 @@ bool FindSector(int nX, int nY, int *nSector); bool CheckProximity(DBloodActor *pSprite, int nX, int nY, int nZ, int nSector, int nDist); bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist); bool CheckProximityWall(int nWall, int x, int y, int nDist); -int GetWallAngle(int nWall); int GetWallAngle(walltype* pWall); void GetWallNormal(int nWall, int *pX, int *pY); bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int *ix, int *iy, int *iz); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 93ba8b14e..cbdf42de9 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1356,7 +1356,7 @@ void nnExtProcessSuperSprites() speed = MulScale(speed, pXSector->busy, 16); } if (sector[pDebris->sectnum].floorstat & 64) - angle = (angle + GetWallAngle(sector[pDebris->sectnum].wallptr) + 512) & 2047; + angle = (angle + GetWallAngle(sector[pDebris->sectnum].firstWall()) + 512) & 2047; int dx = MulScale(speed, Cos(angle), 30); int dy = MulScale(speed, Sin(angle), 30); debrisactor->xvel += dx; diff --git a/source/games/blood/src/prediction.cpp b/source/games/blood/src/prediction.cpp index 57d285f4b..218bf1f66 100644 --- a/source/games/blood/src/prediction.cpp +++ b/source/games/blood/src/prediction.cpp @@ -410,7 +410,7 @@ static void fakeMoveDude(spritetype *pSprite) // ??? } } - actWallBounceVector(&predict.xvel, &predict.yvel, nHitWall, 0); + actWallBounceVector(&predict.xvel, &predict.yvel, pHitWall, 0); break; } }