Skip to content

Commit 0eede97

Browse files
nerzhulZeno-
authored andcommittedJan 21, 2017
Warning fix for 2ea6015 (#5082)
Neither flag as force delete nor show the warning when mapblock is full and object is a player
1 parent 2ea6015 commit 0eede97

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed
 

‎src/serverenvironment.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,9 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
20862086

20872087
if(block)
20882088
{
2089-
if (block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")) {
2089+
// Force delete object if mapblock is full, but ignore players
2090+
if (obj->getType() != ACTIVEOBJECT_TYPE_PLAYER &&
2091+
block->m_static_objects.m_stored.size() >= g_settings->getU16("max_objects_per_block")) {
20902092
warningstream << "ServerEnv: Trying to store id = " << obj->getId()
20912093
<< " statically but block " << PP(blockpos)
20922094
<< " already contains "
@@ -2146,12 +2148,6 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
21462148
continue;
21472149
}
21482150

2149-
// If it's a forced delete, there are too many objects in mapblock
2150-
// Ignore players, they should not be removed on force delete
2151-
if (force_delete && obj->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
2152-
continue;
2153-
}
2154-
21552151
verbosestream<<"ServerEnvironment::deactivateFarObjects(): "
21562152
<<"object id="<<id<<" is not known by clients"
21572153
<<"; deleting"<<std::endl;

0 commit comments

Comments
 (0)
Please sign in to comment.