Skip to content

Commit

Permalink
Fix PlayerSAO deletion warning (0eede97)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Feb 4, 2017
1 parent 047168c commit de664b1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/serverenvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2087,9 +2087,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)

if(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")) {
if (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 @@ -2149,6 +2147,13 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
continue;
}

if (!force_delete && obj->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
warningstream << "ServerEnvironment::deactivateFarObjects(): "
<< "Trying to delete player object, THIS SHOULD NEVER HAPPEN!"
<< std::endl;
continue;
}

verbosestream<<"ServerEnvironment::deactivateFarObjects(): "
<<"object id="<<id<<" is not known by clients"
<<"; deleting"<<std::endl;
Expand Down

0 comments on commit de664b1

Please sign in to comment.