summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-30 21:24:10 +0100
committerHowaner <franzi.moos@googlemail.com>2014-10-30 21:24:10 +0100
commit9c7661f50f82fe265836f3279bf20b15aebba5b3 (patch)
tree85d4deca92d7159d94f9cacb40e0a62cb118b240 /src/ClientHandle.cpp
parentMerge pull request #1576 from mc-server/QtBiomeVisualiserThreadedGen (diff)
downloadcuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar.gz
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar.bz2
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar.lz
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar.xz
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.tar.zst
cuberite-9c7661f50f82fe265836f3279bf20b15aebba5b3.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index faee05450..9b3bd9545 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -2847,7 +2847,9 @@ void cClientHandle::SetUsername( const AString & a_Username)
void cClientHandle::SetViewDistance(int a_ViewDistance)
{
- m_ViewDistance = Clamp(a_ViewDistance, MIN_VIEW_DISTANCE, MAX_VIEW_DISTANCE);
+ ASSERT(m_Player->GetWorld() == NULL);
+
+ m_ViewDistance = Clamp(a_ViewDistance, cClientHandle::MIN_VIEW_DISTANCE, m_Player->GetWorld()->GetMaxViewDistance());
LOGD("Setted %s's view distance to %i", GetUsername().c_str(), m_ViewDistance);
}