diff options
Diffstat (limited to 'library/modules/World.cpp')
| -rw-r--r-- | library/modules/World.cpp | 6 |
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; |
