summaryrefslogtreecommitdiff
path: root/library/modules
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-12 20:57:25 +0400
committerAlexander Gavrilov2012-09-12 20:57:25 +0400
commitf06f9af6b80068fbafe340a59ff7d755399509d4 (patch)
tree9cf964ff50ff76aca83a0ec492ba44b9f1578db0 /library/modules
parent7c71aeab5f44c7fce106a0efc07c1ea2860e4638 (diff)
downloaddfhack-f06f9af6b80068fbafe340a59ff7d755399509d4.tar.gz
dfhack-f06f9af6b80068fbafe340a59ff7d755399509d4.tar.bz2
dfhack-f06f9af6b80068fbafe340a59ff7d755399509d4.tar.xz
Throw items from bins around in siege engine, like minecarts do.
Diffstat (limited to 'library/modules')
-rw-r--r--library/modules/World.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/modules/World.cpp b/library/modules/World.cpp
index e14aa02a..67b8c123 100644
--- a/library/modules/World.cpp
+++ b/library/modules/World.cpp
@@ -300,6 +300,8 @@ PersistentDataItem World::GetPersistentData(const std::string &key, bool *added)
void World::GetPersistentData(std::vector<PersistentDataItem> *vec, const std::string &key, bool prefix)
{
+ vec->clear();
+
if (!BuildPersistentCache())
return;
@@ -343,8 +345,10 @@ bool World::DeletePersistentData(const PersistentDataItem &item)
auto eqrange = d->persistent_index.equal_range(item.key_value);
- for (auto it = eqrange.first; it != eqrange.second; ++it)
+ for (auto it2 = eqrange.first; it2 != eqrange.second; )
{
+ auto it = it2; ++it2;
+
if (it->second != -item.id)
continue;