diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-29 12:57:06 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-29 12:57:06 +0200 |
commit | 365c6f50bd057eb62c66b9b222a07ca6efcb2c47 (patch) | |
tree | 3e53afd563823be135d2616449946fb6b7a55c63 /src/World.cpp | |
parent | Fixed piston power checking (diff) | |
download | cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar.gz cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar.bz2 cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar.lz cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar.xz cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.tar.zst cuberite-365c6f50bd057eb62c66b9b222a07ca6efcb2c47.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/World.cpp b/src/World.cpp index 29046bba9..88e9c32e6 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -3130,10 +3130,8 @@ void cWorld::cTaskUnloadUnusedChunks::Run(cWorld & a_World) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cWorld::cTaskSendBlockTo -cWorld::cTaskSendBlockToAllPlayers::cTaskSendBlockToAllPlayers(int a_BlockX, int a_BlockY, int a_BlockZ) : - m_BlockX(a_BlockX), - m_BlockY(a_BlockY), - m_BlockZ(a_BlockZ) +cWorld::cTaskSendBlockToAllPlayers::cTaskSendBlockToAllPlayers(std::vector<Vector3i> & a_SendQueue) : + m_SendQueue(a_SendQueue) { } @@ -3143,26 +3141,27 @@ void cWorld::cTaskSendBlockToAllPlayers::Run(cWorld & a_World) public cPlayerListCallback { public: - cPlayerCallback(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld & a_World) : - m_BlockX(a_BlockX), - m_BlockY(a_BlockY), - m_BlockZ(a_BlockZ), + cPlayerCallback(std::vector<Vector3i> & a_SendQueue, cWorld & a_World) : + m_SendQueue(a_SendQueue), m_World(a_World) { } virtual bool Item(cPlayer * a_Player) { - m_World.SendBlockTo(m_BlockX, m_BlockY, m_BlockZ, a_Player); + for (std::vector<Vector3i>::const_iterator itr = m_SendQueue.begin(); itr != m_SendQueue.end(); ++itr) + { + m_World.SendBlockTo(itr->x, itr->y, itr->z, a_Player); + } return false; } private: - int m_BlockX, m_BlockY, m_BlockZ; + std::vector<Vector3i> m_SendQueue; cWorld & m_World; - } PlayerCallback(m_BlockX, m_BlockY, m_BlockZ, a_World); + } PlayerCallback(m_SendQueue, a_World); a_World.ForEachPlayer(PlayerCallback); } |