From: Perttu Ahola Date: Mon, 17 Oct 2011 17:57:58 +0000 (+0300) Subject: Made a scheme to get rid of the objects in the worst object flooded blocks X-Git-Tag: 0.3.dev-20111021~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ea1fda5ebc7fe0aa276de768cacd81df365c69a3;p=oweals%2Fminetest.git Made a scheme to get rid of the objects in the worst object flooded blocks --- diff --git a/src/environment.cpp b/src/environment.cpp index 1319e3744..174ee1e1d 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -887,9 +887,10 @@ void ServerEnvironment::step(float dtime) if(block==NULL) continue; active_object_count_wider += - block->m_static_objects.m_active.size(); + block->m_static_objects.m_active.size() + + block->m_static_objects.m_stored.size(); - if(block->m_static_objects.m_stored.size() != 0){ + /*if(block->m_static_objects.m_stored.size() != 0){ errorstream<<"ServerEnvironment::step(): " <getPos())<<" contains " <m_static_objects.m_stored.size() @@ -897,7 +898,7 @@ void ServerEnvironment::step(float dtime) <<"when spawning objects, when counting active " <<"objects in wide area. relative position: " <<"("<getPos()) <<" ("<m_static_objects.m_stored.size() <<" objects)"<m_static_objects.m_stored.size() >= 51); + bool large_amount = (block->m_static_objects.m_stored.size() > 49); if(large_amount){ errorstream<<"suspiciously large amount of objects detected: " <m_static_objects.m_stored.size()<<" in " <getPos()) - <<"; not activating."<m_static_objects.m_stored.clear(); + block->raiseModified(MOD_STATE_WRITE_NEEDED); return; } // A list for objects that couldn't be converted to static for some @@ -1645,10 +1649,12 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) if(block) { - if(block->m_static_objects.m_stored.size() >= 50){ + if(block->m_static_objects.m_stored.size() >= 49){ errorstream<<"ServerEnv: Trying to store id="<getId() <<" statically but block "<m_static_objects.m_stored.size() + <<" (over 49) objects." <<" Forcing delete."<