summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-12-23 23:39:53 +0100
committerTiger Wang <ziwei.tiger@outlook.com>2020-12-26 17:58:53 +0100
commitd9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d (patch)
treec2763ddfe026c2121864d6ca5eae640f01133f7e /src/World.cpp
parentReplace custom ChunkCoordinate with cChunkCoords (diff)
downloadcuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar.gz
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar.bz2
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar.lz
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar.xz
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.tar.zst
cuberite-d9a7c51d4da21976ce3a8d41cde23fc9a4b6eb9d.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 9aa31a14d..02de985c6 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -262,8 +262,7 @@ cWorld::cWorld(
m_BroadcastDeathMessages = IniFile.GetValueSetB("Broadcasting", "BroadcastDeathMessages", true);
m_BroadcastAchievementMessages = IniFile.GetValueSetB("Broadcasting", "BroadcastAchievementMessages", true);
- const auto ClientViewDistance = IniFile.GetValueSetI("SpawnPosition", "MaxViewDistance", static_cast<int>(cClientHandle::DEFAULT_VIEW_DISTANCE));
- m_MaxViewDistance = static_cast<unsigned>(std::clamp(ClientViewDistance, static_cast<int>(cClientHandle::MIN_VIEW_DISTANCE), static_cast<int>(cClientHandle::MAX_VIEW_DISTANCE)));
+ SetMaxViewDistance(IniFile.GetValueSetI("SpawnPosition", "MaxViewDistance", cClientHandle::DEFAULT_VIEW_DISTANCE));
// Try to find the "SpawnPosition" key and coord values in the world configuration, set the flag if found
int KeyNum = IniFile.FindKey("SpawnPosition");
@@ -1840,7 +1839,7 @@ bool cWorld::SetAreaBiome(const cCuboid & a_Area, EMCSBiome a_Biome)
-void cWorld::SetMaxViewDistance(unsigned a_MaxViewDistance)
+void cWorld::SetMaxViewDistance(int a_MaxViewDistance)
{
m_MaxViewDistance = Clamp(a_MaxViewDistance, cClientHandle::MIN_VIEW_DISTANCE, cClientHandle::MAX_VIEW_DISTANCE);
}