diff options
author | Mattes D <github@xoft.cz> | 2015-09-19 01:21:01 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-09-19 01:21:01 +0200 |
commit | 9b3933d641dc5cb687071706559745bdfc5093e4 (patch) | |
tree | 0290ae524adb44f2c1909a0edc8c7cc5e1d29c44 /src/Chunk.h | |
parent | Merge pull request #2480 from cuberite/CircleCiCheckBasicStyle (diff) | |
parent | Removed a significant performance issue. (diff) | |
download | cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar.gz cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar.bz2 cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar.lz cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar.xz cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.tar.zst cuberite-9b3933d641dc5cb687071706559745bdfc5093e4.zip |
Diffstat (limited to 'src/Chunk.h')
-rw-r--r-- | src/Chunk.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Chunk.h b/src/Chunk.h index fd9ea0b0c..683965c62 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -439,7 +439,12 @@ public: void SetAlwaysTicked(bool a_AlwaysTicked); // Makes a copy of the list - cClientHandleList GetAllClients(void) const {return m_LoadedByClient; } + cClientHandleList GetAllClients(void) const + { + cClientHandleList copy; + std::copy(m_LoadedByClient.begin(), m_LoadedByClient.end(), std::back_inserter(copy)); + return copy; + } private: @@ -479,9 +484,9 @@ private: sSetBlockQueueVector m_SetBlockQueue; ///< Block changes that are queued to a specific tick // A critical section is not needed, because all chunk access is protected by its parent ChunkMap's csLayers - cClientHandleList m_LoadedByClient; - cEntityList m_Entities; - cBlockEntityList m_BlockEntities; + std::vector<cClientHandle *> m_LoadedByClient; + cEntityList m_Entities; + cBlockEntityList m_BlockEntities; /** Number of times the chunk has been requested to stay (by various cChunkStay objects); if zero, the chunk can be unloaded */ int m_StayCount; |