mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement unloading of static_save=false objects according to existing docs (#10485)
This commit is contained in:
parent
660115c1ab
commit
4f2303849e
4 changed files with 17 additions and 3 deletions
|
@ -1972,8 +1972,8 @@ void ServerEnvironment::deactivateFarObjects(bool _force_delete)
|
|||
// force_delete might be overriden per object
|
||||
bool force_delete = _force_delete;
|
||||
|
||||
// Do not deactivate if static data creation not allowed
|
||||
if (!force_delete && !obj->isStaticAllowed())
|
||||
// Do not deactivate if disallowed
|
||||
if (!force_delete && !obj->shouldUnload())
|
||||
return false;
|
||||
|
||||
// removeRemovedObjects() is responsible for these
|
||||
|
@ -2002,7 +2002,10 @@ void ServerEnvironment::deactivateFarObjects(bool _force_delete)
|
|||
}
|
||||
|
||||
// If block is still active, don't remove
|
||||
if (!force_delete && m_active_blocks.contains(blockpos_o))
|
||||
bool still_active = obj->isStaticAllowed() ?
|
||||
m_active_blocks.contains(blockpos_o) :
|
||||
getMap().getBlockNoCreateNoEx(blockpos_o) != nullptr;
|
||||
if (!force_delete && still_active)
|
||||
return false;
|
||||
|
||||
verbosestream << "ServerEnvironment::deactivateFarObjects(): "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue