aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-15 14:37:35 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-15 14:37:35 +0300
commita35e4bdbda78fe044c263b7866fd0c2db16565da (patch)
tree117430caf2c31979e62fa578ff802863f4ccf870 /src
parent0aeb5adb8f650c57758539c9025d92305096bd64 (diff)
downloadminetest-a35e4bdbda78fe044c263b7866fd0c2db16565da.tar.gz
minetest-a35e4bdbda78fe044c263b7866fd0c2db16565da.tar.bz2
minetest-a35e4bdbda78fe044c263b7866fd0c2db16565da.zip
Add a hack to get rid of the rare "ERROR: StaticObjectList::insert(): id already exists" failure
Diffstat (limited to 'src')
-rw-r--r--src/environment.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 43dbb65d0..f0ba097e0 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -1748,6 +1748,15 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
force_delete = true;
} else {
u16 new_id = pending_delete ? id : 0;
+ // If static counterpart already exists, remove it first.
+ // This shouldn't happen, but happens rarely for some
+ // unknown reason. Unsuccessful attempts have been made to
+ // find said reason.
+ if(new_id && block->m_static_objects.m_active.find(new_id)){
+ infostream<<"ServerEnv: WARNING: Performing hack #83274"
+ <<std::endl;
+ block->m_static_objects.remove(new_id);
+ }
block->m_static_objects.insert(new_id, s_obj);
// Only mark block as modified if data changed considerably