Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tactical/Tactical Save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ BOOLEAN SaveCurrentSectorsInformationToTempItemFile( )
// handle all reachable before save
HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
UpdateWorldItems(gWorldSectorX, gWorldSectorY, gbWorldSectorZ, guiNumWorldItems, gWorldItems);
PruneWorldItems();

std::vector<ROTTING_CORPSE_DEFINITION> corpsedefvector;

Expand Down Expand Up @@ -3169,7 +3170,6 @@ void LoadWorldItemsFromTempFiles(INT16 sMapX, INT16 sMapY, INT8 bMapZ)

void SaveWorldItemsToTempFiles()
{
PruneWorldItems();
for (size_t i = 0; i < gAllWorldItems.sectors.size(); i++)
{
const auto x = gAllWorldItems.sectors[i].x;
Expand Down
5 changes: 5 additions & 0 deletions Tactical/World Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ void PruneWorldItems(void)
}
else
{
auto x = gAllWorldItems.sectors[i].x;
auto y = gAllWorldItems.sectors[i].y;
auto z = gAllWorldItems.sectors[i].z;
ReSetSectorFlag(x, y, z, SF_ITEM_TEMP_FILE_EXISTS);

gAllWorldItems.sectors.erase(gAllWorldItems.sectors.begin() + i);
gAllWorldItems.NumItems.erase(gAllWorldItems.NumItems.begin() + i);
gAllWorldItems.Items.erase(gAllWorldItems.Items.begin() + i);
Expand Down