From f06f9af6b80068fbafe340a59ff7d755399509d4 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 12 Sep 2012 20:57:25 +0400 Subject: Throw items from bins around in siege engine, like minecarts do. --- library/modules/World.cpp | 6 +++++- library/xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'library') 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 *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; diff --git a/library/xml b/library/xml index d55f1cf4..2bc8fbdf 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit d55f1cf43dd71d3abee724bfa88a0a401b4ccaa3 +Subproject commit 2bc8fbdf71143398817d31e06e169a01cce37c50 -- cgit v1.2.1