1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-17 07:05:29 +01:00

ServerEnv: Clean up object lifecycle handling (#6414)

* ServerEnv: Clean up object lifecycle handling
This commit is contained in:
sfan5
2017-09-15 12:19:01 +02:00
committed by SmallJoker
parent 5b2461c713
commit c2a0333901
9 changed files with 185 additions and 224 deletions

View File

@@ -33,6 +33,7 @@ class PlayerDatabase;
class PlayerSAO;
class ServerEnvironment;
class ActiveBlockModifier;
struct StaticObject;
class ServerActiveObject;
class Server;
class ServerScripting;
@@ -362,7 +363,7 @@ private:
u16 addActiveObjectRaw(ServerActiveObject *object, bool set_changed, u32 dtime_s);
/*
Remove all objects that satisfy (m_removed && m_known_by_count==0)
Remove all objects that satisfy (isGone() && m_known_by_count==0)
*/
void removeRemovedObjects();
@@ -382,6 +383,14 @@ private:
*/
void deactivateFarObjects(bool force_delete);
/*
A few helpers used by the three above methods
*/
void deleteStaticFromBlock(
ServerActiveObject *obj, u16 id, u32 mod_reason, bool no_emerge);
bool saveStaticToBlock(v3s16 blockpos, u16 store_id,
ServerActiveObject *obj, const StaticObject &s_obj, u32 mod_reason);
/*
Member variables
*/