mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed missed VD update bug
This commit is contained in:
parent
3239fc1f2f
commit
23c774c8da
@ -146,20 +146,20 @@ impl Sys {
|
||||
},
|
||||
ClientMsg::SetViewDistance(view_distance) => {
|
||||
if let ClientState::Character { .. } = client.client_state {
|
||||
players.get_mut(entity).map(|player| {
|
||||
player.view_distance = Some(
|
||||
settings
|
||||
.max_view_distance
|
||||
.map(|max| view_distance.min(max))
|
||||
.unwrap_or(view_distance),
|
||||
)
|
||||
});
|
||||
|
||||
if settings
|
||||
.max_view_distance
|
||||
.map(|max| view_distance <= max)
|
||||
.unwrap_or(true)
|
||||
.map(|max| view_distance > max)
|
||||
.unwrap_or(false)
|
||||
{
|
||||
players.get_mut(entity).map(|player| {
|
||||
player.view_distance = Some(
|
||||
settings
|
||||
.max_view_distance
|
||||
.map(|max| view_distance.min(max))
|
||||
.unwrap_or(view_distance),
|
||||
)
|
||||
});
|
||||
} else {
|
||||
client.notify(ServerMsg::SetViewDistance(
|
||||
settings.max_view_distance.unwrap_or(0),
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user