Fixed a wrong assert in cClientHandle::SetViewDistance().
This commit is contained in:
parent
95e59056a1
commit
ae15c2f78e
@ -2848,11 +2848,15 @@ void cClientHandle::SetUsername( const AString & a_Username)
|
|||||||
|
|
||||||
void cClientHandle::SetViewDistance(int a_ViewDistance)
|
void cClientHandle::SetViewDistance(int a_ViewDistance)
|
||||||
{
|
{
|
||||||
ASSERT(m_Player->GetWorld() == NULL);
|
|
||||||
|
|
||||||
m_RequestedViewDistance = a_ViewDistance;
|
m_RequestedViewDistance = a_ViewDistance;
|
||||||
m_CurrentViewDistance = Clamp(a_ViewDistance, cClientHandle::MIN_VIEW_DISTANCE, m_Player->GetWorld()->GetMaxViewDistance());
|
LOGD("%s is requesting ViewDistance of %d!", GetUsername().c_str(), m_RequestedViewDistance);
|
||||||
LOGD("Setted view distance from %s to %d!", GetUsername().c_str(), m_CurrentViewDistance);
|
|
||||||
|
// Set the current view distance based on the requested VD and world max VD:
|
||||||
|
cWorld * world = m_Player->GetWorld();
|
||||||
|
if (world != nullptr)
|
||||||
|
{
|
||||||
|
m_CurrentViewDistance = Clamp(a_ViewDistance, cClientHandle::MIN_VIEW_DISTANCE, world->GetMaxViewDistance());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user