summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/World.h')
-rw-r--r--src/World.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/World.h b/src/World.h
index c1794b159..a00e181b6 100644
--- a/src/World.h
+++ b/src/World.h
@@ -61,6 +61,7 @@ class cBroadcaster;
typedef std::list< cPlayer * > cPlayerList;
+typedef std::list< std::pair< cPlayer *, cWorld * > > cAwaitingPlayerList;
typedef SharedPtr<cSetChunkData> cSetChunkDataPtr; // TODO: Change to unique_ptr once we go C++11
typedef std::vector<cSetChunkDataPtr> cSetChunkDataPtrs;
@@ -262,8 +263,9 @@ public:
/** Adds the player to the world.
Uses a queue to store the player object until the Tick thread processes the addition event.
- Also adds the player as an entity in the chunkmap, and the player's ClientHandle, if any, for ticking. */
- void AddPlayer(cPlayer * a_Player);
+ Also adds the player as an entity in the chunkmap, and the player's ClientHandle, if any, for ticking.
+ If a_OldWorld is provided, a corresponding ENTITY_CHANGED_WORLD event is triggerred after the addition. */
+ void AddPlayer(cPlayer * a_Player, cWorld * a_OldWorld = nullptr);
/** Removes the player from the world.
Removes the player from the addition queue, too, if appropriate.
@@ -1006,7 +1008,7 @@ private:
cCriticalSection m_CSPlayersToAdd;
/** List of players that are scheduled for adding, waiting for the Tick thread to add them. */
- cPlayerList m_PlayersToAdd;
+ cAwaitingPlayerList m_PlayersToAdd;
/** CS protecting m_SetChunkDataQueue. */
cCriticalSection m_CSSetChunkDataQueue;