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.
This commit is contained in:
Asdow
2026-05-06 11:28:11 +03:00
parent 5697acabb3
commit 78ed49c73d
+4
View File
@@ -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 )