Fix crates and barrels "stealing" the items from other containers when they are pushed over them

Fix stone blocks disappearing when pushed
This commit is contained in:
2015-06-06 23:23:45 -04:00
parent 58fbf3b287
commit 722f670e3d
14 changed files with 62 additions and 46 deletions

View File

@@ -266,6 +266,17 @@ bool load_party_v1(fs::path file_to_load, cUniverse& univ, bool town_restore, bo
univ.append(town_maps);
univ.append(o_maps);
univ.town.append(sfx, misc_i);
// Check items in crates/barrels
for(int i = 0; i < univ.town->max_dim(); i++) {
for(int j = 0; j < univ.town->max_dim(); j++) {
if(univ.town.is_barrel(i,j) || univ.town.is_crate(i,j)) {
for(cItem item : univ.town.items) {
if(item.item_loc == loc(i,j) && item.contained)
item.held = true;
}
}
}
}
}
return true;