1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-15 22:05:07 -05:00

Fix PlayerSAO deletion warning (0eede97af2)

This commit is contained in:
sfan5 2017-02-04 13:31:21 +01:00
parent 047168ca83
commit de664b1c6d

View File

@ -2087,9 +2087,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
if(block) if(block)
{ {
// Force delete object if mapblock is full, but ignore players if (block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")) {
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() warningstream << "ServerEnv: Trying to store id = " << obj->getId()
<< " statically but block " << PP(blockpos) << " statically but block " << PP(blockpos)
<< " already contains " << " already contains "
@ -2149,6 +2147,13 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
continue; 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(): " verbosestream<<"ServerEnvironment::deactivateFarObjects(): "
<<"object id="<<id<<" is not known by clients" <<"object id="<<id<<" is not known by clients"
<<"; deleting"<<std::endl; <<"; deleting"<<std::endl;