summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-10-05 14:09:42 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-12-18 22:03:40 +0100
commit090d8305e4e3c3ee085a897b72f2b4708e183eb8 (patch)
treee703cc7fcb7f16c85f16b094d5df0bd0a8d698e8 /src/Server.cpp
parentHorsies: don't always broadcast metadata (diff)
downloadcuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.gz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.bz2
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.lz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.xz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.zst
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.zip
Diffstat (limited to 'src/Server.cpp')
-rw-r--r--src/Server.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 2730d3511..4cb28d6ea 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -214,16 +214,20 @@ bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_Shoul
m_ShouldLoadOfflinePlayerData = a_Settings.GetValueSetB("PlayerData", "LoadOfflinePlayerData", false);
m_ShouldLoadNamedPlayerData = a_Settings.GetValueSetB("PlayerData", "LoadNamedPlayerData", true);
- m_ClientViewDistance = a_Settings.GetValueSetI("Server", "DefaultViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE);
- if (m_ClientViewDistance < cClientHandle::MIN_VIEW_DISTANCE)
+ const auto ClientViewDistance = a_Settings.GetValueSetI("Server", "DefaultViewDistance", static_cast<int>(cClientHandle::DEFAULT_VIEW_DISTANCE));
+ if (ClientViewDistance < static_cast<int>(cClientHandle::MIN_VIEW_DISTANCE))
{
m_ClientViewDistance = cClientHandle::MIN_VIEW_DISTANCE;
- LOGINFO("Setting default viewdistance to the minimum of %d", m_ClientViewDistance);
+ LOGINFO("Setting default view distance to the minimum of %d", m_ClientViewDistance);
}
- if (m_ClientViewDistance > cClientHandle::MAX_VIEW_DISTANCE)
+ else if (ClientViewDistance > static_cast<int>(cClientHandle::MAX_VIEW_DISTANCE))
{
m_ClientViewDistance = cClientHandle::MAX_VIEW_DISTANCE;
- LOGINFO("Setting default viewdistance to the maximum of %d", m_ClientViewDistance);
+ LOGINFO("Setting default view distance to the maximum of %d", m_ClientViewDistance);
+ }
+ else
+ {
+ m_ClientViewDistance = static_cast<unsigned>(ClientViewDistance);
}
PrepareKeys();