Skip to content

Commit

Permalink
Warning fix for 2ea6015 (#5082)
Browse files Browse the repository at this point in the history
Neither flag as force delete nor show the warning when mapblock is full and object is a player
  • Loading branch information
nerzhul authored and Zeno- committed Jan 21, 2017
1 parent 2ea6015 commit 0eede97
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/serverenvironment.cpp
Expand Up @@ -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 "
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0eede97

Please sign in to comment.