summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-06 22:31:16 +0200
committerMattes D <github@xoft.cz>2014-06-08 21:58:29 +0200
commitb904223b9dbbe7b696dbd30e748bc131742e11ea (patch)
treed742f036732e34a4c11f72f906c6f90c7d6ba231 /src/World.h
parentSmall change for easier understanding. (diff)
downloadcuberite-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 '')
-rw-r--r--src/World.h9
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();