summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-09-12 21:43:18 +0200
committerGitHub <noreply@github.com>2020-09-12 21:43:18 +0200
commit198407807f1241ea2b06179bcc036f9373c7258e (patch)
treef0e4f690aaa1d35fa43115c8aa102b7f127ee70a /src/ChunkSender.cpp
parentUse tracing for explosions (#4845) (diff)
downloadcuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar.gz
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar.bz2
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar.lz
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar.xz
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.tar.zst
cuberite-198407807f1241ea2b06179bcc036f9373c7258e.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkSender.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp
index e00b86795..c93a764b2 100644
--- a/src/ChunkSender.cpp
+++ b/src/ChunkSender.cpp
@@ -33,7 +33,7 @@ class cNotifyChunkSender :
a_Coords.m_ChunkX, a_Coords.m_ChunkZ,
[&ChunkSender] (cChunk & a_Chunk) -> bool
{
- ChunkSender.QueueSendChunkTo(a_Chunk.GetPosX(), a_Chunk.GetPosZ(), cChunkSender::E_CHUNK_PRIORITY_MIDHIGH, a_Chunk.GetAllClients());
+ ChunkSender.QueueSendChunkTo(a_Chunk.GetPosX(), a_Chunk.GetPosZ(), cChunkSender::Priority::High, a_Chunk.GetAllClients());
return true;
}
);
@@ -89,7 +89,7 @@ void cChunkSender::Stop(void)
-void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cClientHandle * a_Client)
+void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, Priority a_Priority, cClientHandle * a_Client)
{
ASSERT(a_Client != nullptr);
{
@@ -99,7 +99,7 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a
if (iter != m_ChunkInfo.end())
{
auto & info = iter->second;
- if (info.m_Priority > a_Priority)
+ if (info.m_Priority < a_Priority) // Was the chunk's priority boosted?
{
m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
info.m_Priority = a_Priority;
@@ -121,7 +121,7 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a
-void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cChunkClientHandles a_Clients)
+void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, Priority a_Priority, cChunkClientHandles a_Clients)
{
{
cChunkCoords Chunk{a_ChunkX, a_ChunkZ};
@@ -130,7 +130,7 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a
if (iter != m_ChunkInfo.end())
{
auto & info = iter->second;
- if (info.m_Priority > a_Priority)
+ if (info.m_Priority < a_Priority) // Was the chunk's priority boosted?
{
m_SendChunks.push(sChunkQueue{a_Priority, Chunk});
info.m_Priority = a_Priority;