diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-01-21 11:29:18 +0100 |
---|---|---|
committer | Zeno- <kde.psych@gmail.com> | 2017-01-21 20:29:18 +1000 |
commit | 0eede97af2927dcda3545192403b0a44f30bcd1f (patch) | |
tree | 51547c15a02c97279f1f6f86f5cb654f2d859b3d | |
parent | 2ea60156437962d7d29d20606bf5d9189059f76b (diff) | |
download | minetest-0eede97af2927dcda3545192403b0a44f30bcd1f.tar.gz minetest-0eede97af2927dcda3545192403b0a44f30bcd1f.tar.bz2 minetest-0eede97af2927dcda3545192403b0a44f30bcd1f.zip |
Warning fix for 2ea60156437962d7d29d20606bf5d9189059f76b (#5082)
Neither flag as force delete nor show the warning when mapblock is full and object is a player
-rw-r--r-- | src/serverenvironment.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp index 41cd63684..01dc3ff10 100644 --- a/src/serverenvironment.cpp +++ b/src/serverenvironment.cpp @@ -2086,7 +2086,9 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) if(block) { - if (block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")) { + // Force delete object if mapblock is full, but ignore players + if (obj->getType() != ACTIVEOBJECT_TYPE_PLAYER && + block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")) { warningstream << "ServerEnv: Trying to store id = " << obj->getId() << " statically but block " << PP(blockpos) << " already contains " @@ -2146,12 +2148,6 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete) continue; } - // If it's a forced delete, there are too many objects in mapblock - // Ignore players, they should not be removed on force delete - if (force_delete && obj->getType() == ACTIVEOBJECT_TYPE_PLAYER) { - continue; - } - verbosestream<<"ServerEnvironment::deactivateFarObjects(): " <<"object id="<<id<<" is not known by clients" <<"; deleting"<<std::endl; |