diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 3bbb1ed51..73259b5c7 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -227,7 +227,7 @@ inline DExhumedActor* insertActor(sectortype* s, int st) } DExhumedActor* GrabBody(); DExhumedActor* GrabBodyGunSprite(); -void CreatePushBlock(int nSector); +void CreatePushBlock(sectortype* pSector); void FuncCreatureChunk(int a, int, int nRun); DExhumedActor* FindPlayer(DExhumedActor* nSprite, int nDistance, bool dontengage = false); @@ -286,15 +286,15 @@ void FuncTrap(int, int, int, int); void FuncEnergyBlock(int, int, int, int); void FuncSpark(int, int, int, int); void SnapBobs(sectortype* nSectorA, sectortype* nSectorB); -DExhumedActor* FindWallSprites(int nSector); -void AddMovingSector(int nSector, int edx, int ebx, int ecx); +DExhumedActor* FindWallSprites(sectortype* nSector); +void AddMovingSector(sectortype* nSector, int edx, int ebx, int ecx); void ProcessTrailSprite(DExhumedActor* nSprite, int nLotag, int nHitag); void AddSectorBob(sectortype* nSector, int nHitag, int bx); DExhumedActor* BuildObject(DExhumedActor* nSprite, int nOjectType, int nHitag); int BuildArrow(DExhumedActor* nSprite, int nVal); int BuildFireBall(DExhumedActor*, int a, int b); void BuildDrip(DExhumedActor* nSprite); -DExhumedActor* BuildEnergyBlock(int nSector); +DExhumedActor* BuildEnergyBlock(sectortype* nSector); int BuildElevC(int arg1, int nChannel, sectortype* nSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...); int BuildElevF(int nChannel, sectortype* nSector, DExhumedActor* nWallSprite, int arg_4, int arg_5, int nCount, ...); int BuildWallFace(int nChannel, walltype* pWall, int nCount, ...); diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 790f9bfe1..2f884e2a3 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -804,39 +804,38 @@ int GrabPushBlock() return nPushBlocks++; } -void CreatePushBlock(int nSector) +void CreatePushBlock(sectortype* pSector) { - auto sectp = §or[nSector]; int nBlock = GrabPushBlock(); int xSum = 0; int ySum = 0; - for (auto& wal : wallsofsector(sectp)) + for (auto& wal : wallsofsector(pSector)) { xSum += wal.x; ySum += wal.y; } - int xAvg = xSum / sectp->wallnum; - int yAvg = ySum / sectp->wallnum; + int xAvg = xSum / pSector->wallnum; + int yAvg = ySum / pSector->wallnum; sBlockInfo[nBlock].x = xAvg; sBlockInfo[nBlock].y = yAvg; - auto pActor = insertActor(nSector, 0); + auto pActor = insertActor(pSector, 0); auto pSprite = &pActor->s(); sBlockInfo[nBlock].pActor = pActor; pSprite->x = xAvg; pSprite->y = yAvg; - pSprite->z = sectp->floorz - 256; + pSprite->z = pSector->floorz - 256; pSprite->cstat = 0x8000; int var_28 = 0; - for (auto& wal : wallsofsector(sectp)) + for (auto& wal : wallsofsector(pSector)) { uint32_t xDiff = abs(xAvg - wal.x); uint32_t yDiff = abs(yAvg - wal.y); @@ -858,7 +857,7 @@ void CreatePushBlock(int nSector) sBlockInfo[nBlock].field_8 = var_28; pSprite->clipdist = (var_28 & 0xFF) << 2; - sectp->extra = nBlock; + pSector->extra = nBlock; } void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index e3ad3cc3e..7f9373fae 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2298,10 +2298,9 @@ void ProcessTrailSprite(DExhumedActor* pActor, int nLotag, int nHitag) } // ok? -void AddMovingSector(int nSector, int edx, int ebx, int ecx) +void AddMovingSector(sectortype* pSector, int edx, int ebx, int ecx) { - auto pSector = §or[nSector]; - CreatePushBlock(nSector); + CreatePushBlock(pSector); setsectinterpolate(pSector); int nTrail = FindTrail(ebx); diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 2eccd7470..804989ab5 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -1168,37 +1168,37 @@ void runlist_ProcessSectorTag(sectortype* pSector, int nLotag, int nHitag) case 40: // Moving sector(follows waypoints) { - AddMovingSector(sectnum(pSector), nLotag, nHitag % 1000, 2); + AddMovingSector(pSector, nLotag, nHitag % 1000, 2); return; } case 41: // Moving sector(follows waypoints) { - AddMovingSector(sectnum(pSector), nLotag, nHitag % 1000, 18); + AddMovingSector(pSector, nLotag, nHitag % 1000, 18); return; } case 42: // Moving sector(follows waypoints) { - AddMovingSector(sectnum(pSector), nLotag, nHitag % 1000, 58); + AddMovingSector(pSector, nLotag, nHitag % 1000, 58); return; } case 43: // Moving sector(follows waypoints) { - AddMovingSector(sectnum(pSector), nLotag, nHitag % 1000, 122); + AddMovingSector(pSector, nLotag, nHitag % 1000, 122); return; } case 44: // Moving sector(follows waypoints) { - AddMovingSector(sectnum(pSector), nLotag, nHitag % 1000, 90); + AddMovingSector(pSector, nLotag, nHitag % 1000, 90); return; } case 45: // Pushbox sector { - CreatePushBlock(sectnum(pSector)); + CreatePushBlock(pSector); return; }