From 78ed49c73de51b22bc816fcf37d7efc950bb8dc2 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Wed, 6 May 2026 11:26:37 +0300 Subject: [PATCH] Remove corpse structure from world when removing corpse Fixes not being able to take all corpses from one tile, if multiple corpses were stacked on top of each other. With the structure not deleted, the GetCorpseAtGridNo would not find an existing corpse anymore. --- Tactical/Rotting Corpses.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tactical/Rotting Corpses.cpp b/Tactical/Rotting Corpses.cpp index 691953f5..f0e28727 100644 --- a/Tactical/Rotting Corpses.cpp +++ b/Tactical/Rotting Corpses.cpp @@ -713,6 +713,10 @@ void RemoveCorpse( INT32 iCorpseID ) DeleteAniTile( gRottingCorpse[ iCorpseID ].pAniTile ); FreeCorpsePalettes( &( gRottingCorpse[ iCorpseID ] ) ); + + const auto sGridNo = gRottingCorpse[iCorpseID].def.sGridNo; + auto pStructure = FindLastStructure(sGridNo, STRUCTURE_CORPSE); + DeleteStructureFromWorld(pStructure); } BOOLEAN CreateCorpsePalette( ROTTING_CORPSE *pCorpse )