diff options
author | Novatux <nathanael.courant@laposte.net> | 2013-08-04 14:14:21 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2013-08-04 15:28:01 +0300 |
commit | fe1fe1b1e42d24dc87a75ef8cc27c5c1dd1cfa4d (patch) | |
tree | c516a09c0fc00318f4a2bd3d4057fa6618e1a2b4 /src | |
parent | e6687be4933e5115d31ade014300648051af5047 (diff) | |
download | minetest-fe1fe1b1e42d24dc87a75ef8cc27c5c1dd1cfa4d.tar.gz minetest-fe1fe1b1e42d24dc87a75ef8cc27c5c1dd1cfa4d.tar.bz2 minetest-fe1fe1b1e42d24dc87a75ef8cc27c5c1dd1cfa4d.zip |
Change large amount of objects to be configurable via a setting in minetest.conf (max_objects_per_block).
Diffstat (limited to 'src')
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/environment.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 326e11b8f..33adf102f 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -180,6 +180,7 @@ void set_default_settings(Settings *settings) settings->setDefault("time_speed", "72"); settings->setDefault("year_days", "30"); settings->setDefault("server_unload_unused_data_timeout", "29"); + settings->setDefault("max_objects_per_block", "49"); settings->setDefault("server_map_save_interval", "5.3"); settings->setDefault("full_block_send_enable_min_time_from_building", "2.0"); settings->setDefault("dedicated_server_step", "0.1"); diff --git a/src/environment.cpp b/src/environment.cpp index 63718f3fc..40dba9a6c 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1703,7 +1703,7 @@ void ServerEnvironment::activateObjects(MapBlock *block, u32 dtime_s) <<"activating objects of block "<<PP(block->getPos()) <<" ("<<block->m_static_objects.m_stored.size() <<" objects)"<<std::endl; - bool large_amount = (block->m_static_objects.m_stored.size() > 49); + bool large_amount = (block->m_static_objects.m_stored.size() > g_settings->getU16("max_objects_per_block")); if(large_amount){ errorstream<<"suspiciously large amount of objects detected: " <<block->m_static_objects.m_stored.size()<<" in " @@ -1881,12 +1881,12 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) if(block) { - if(block->m_static_objects.m_stored.size() >= 49){ + if(block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")){ errorstream<<"ServerEnv: Trying to store id="<<obj->getId() <<" statically but block "<<PP(blockpos) <<" already contains " <<block->m_static_objects.m_stored.size() - <<" (over 49) objects." + <<" objects." <<" Forcing delete."<<std::endl; force_delete = true; } else { |