From 4197a7ed848505238fb2a354476c85be5f6edd80 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 22 Oct 2021 17:45:06 +0200 Subject: [PATCH] - BlockInfo --- source/games/exhumed/src/aistuff.h | 2 +- source/games/exhumed/src/move.cpp | 8 ++++---- source/games/exhumed/src/player.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 4384faf05..b730c740f 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -201,10 +201,10 @@ void FuncLion(int, int, int, int); // 16 bytes struct BlockInfo { + DExhumedActor* pActor; int x; int y; int field_8; - short nSprite; }; extern BlockInfo sBlockInfo[]; diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index b1fe8f3e1..b47969b07 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -59,7 +59,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, BlockInfo& w, Bloc if (arc.BeginObject(keyname)) { arc("at8", w.field_8) - ("sprite", w.nSprite) + ("sprite", w.pActor) ("x", w.x) ("y", w.y) .EndObject(); @@ -870,10 +870,10 @@ void CreatePushBlock(int nSector) sBlockInfo[nBlock].x = xAvg; sBlockInfo[nBlock].y = yAvg; - int nSprite = insertsprite(nSector, 0); - auto pSprite = &sprite[nSprite]; + auto pActor = insertActor(nSector, 0); + auto pSprite = &pActor->s(); - sBlockInfo[nBlock].nSprite = nSprite; + sBlockInfo[nBlock].pActor = pActor; pSprite->x = xAvg; pSprite->y = yAvg; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index fa02d4c10..eb2264c55 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1059,9 +1059,9 @@ void AIPlayer::Tick(RunListEvent* ev) { PlayerList[nPlayer].nPlayerPushSound = 1; short nBlock = sector[PlayerList[nPlayer].nPlayerPushSect].extra; - int nBlockSprite = sBlockInfo[nBlock].nSprite; + auto pBlockActor = sBlockInfo[nBlock].pActor; - D3PlayFX(StaticSound[kSound23], nBlockSprite, 0x4000); + D3PlayFX(StaticSound[kSound23], pBlockActor, 0x4000); } else { @@ -1085,7 +1085,7 @@ void AIPlayer::Tick(RunListEvent* ev) { if (PlayerList[nPlayer].nPlayerPushSect > -1) { - StopActorSound(&exhumedActors[sBlockInfo[sector[PlayerList[nPlayer].nPlayerPushSect].extra].nSprite]); + StopActorSound(sBlockInfo[sector[PlayerList[nPlayer].nPlayerPushSect].extra].pActor); } PlayerList[nPlayer].nPlayerPushSound = -1;