diff options
author | Mattes D <github@xoft.cz> | 2014-06-06 22:31:16 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-06-08 21:58:29 +0200 |
commit | b904223b9dbbe7b696dbd30e748bc131742e11ea (patch) | |
tree | d742f036732e34a4c11f72f906c6f90c7d6ba231 /src/World.h | |
parent | Small change for easier understanding. (diff) | |
download | cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.gz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.bz2 cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.lz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.xz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.zst cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.zip |
Diffstat (limited to 'src/World.h')
-rw-r--r-- | src/World.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/World.h b/src/World.h index 98b241a2b..4c014a976 100644 --- a/src/World.h +++ b/src/World.h @@ -301,7 +301,8 @@ public: void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player - /** Adds the entity into its appropriate chunk; takes ownership of the entity ptr */ + /** Adds the entity into its appropriate chunk; takes ownership of the entity ptr. + The entity is added lazily - this function only puts it in a queue that is then processed by the Tick thread. */ void AddEntity(cEntity * a_Entity); bool HasEntity(int a_UniqueID); @@ -926,6 +927,12 @@ private: /** Clients that are scheduled for adding, waiting for TickClients to add them */ cClientHandleList m_ClientsToAdd; + /** Guards m_EntitiesToAdd */ + cCriticalSection m_CSEntitiesToAdd; + + /** List of entities that are scheduled for adding, waiting for the Tick thread to add them. */ + cEntityList m_EntitiesToAdd; + cWorld(const AString & a_WorldName); virtual ~cWorld(); |