diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-10-07 21:36:01 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-10-07 21:36:01 +0200 |
commit | 97623fc634263eeff99e25b7527fde318108ea0d (patch) | |
tree | 21646504bcc22ffe3992ab5f72282373930bfc43 /src | |
parent | Stream 4 chunks per tick. Added priority. (diff) | |
download | cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar.gz cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar.bz2 cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar.lz cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar.xz cuberite-97623fc634263eeff99e25b7527fde318108ea0d.tar.zst cuberite-97623fc634263eeff99e25b7527fde318108ea0d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 588a1caba..897ee9e9e 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -443,6 +443,12 @@ bool cClientHandle::StreamNextChunk(void) int ChunkZ = RangeZ + ((Z >= 4) ? (3 - Z) : Z); cChunkCoords Coords(ChunkX, ChunkZ); + // Checks if the chunk is in distance + if ((Diff(ChunkX, ChunkPosX) > m_ViewDistance) || (Diff(ChunkZ, ChunkPosZ) > m_ViewDistance)) + { + continue; + } + // If the chunk already loading/loaded -> skip if ( (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) || @@ -478,6 +484,12 @@ bool cClientHandle::StreamNextChunk(void) int ChunkZ = RangeZ + ((Z >= 4) ? (3 - Z) : Z); cChunkCoords Coords(ChunkX, ChunkZ); + // Checks if the chunk is in distance + if ((Diff(ChunkX, ChunkPosX) > m_ViewDistance) || (Diff(ChunkZ, ChunkPosZ) > m_ViewDistance)) + { + continue; + } + // If the chunk already loading/loaded -> skip if ( (std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) || |