mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Change large amount of objects to be configurable via a setting in minetest.conf (max_objects_per_block).
This commit is contained in:
parent
e6687be493
commit
fe1fe1b1e4
3 changed files with 6 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue