From: Perttu Ahola Date: Sun, 15 Apr 2012 11:37:35 +0000 (+0300) Subject: Add a hack to get rid of the rare "ERROR: StaticObjectList::insert(): id already... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=a35e4bdbda78fe044c263b7866fd0c2db16565da;p=zefram%2Fminetest%2Fminetest_engine.git Add a hack to get rid of the rare "ERROR: StaticObjectList::insert(): id already exists" failure --- diff --git a/src/environment.cpp b/src/environment.cpp index 43dbb65d..f0ba097e 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" + <m_static_objects.remove(new_id); + } block->m_static_objects.insert(new_id, s_obj); // Only mark block as modified if data changed considerably