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:
@ -146,20 +146,20 @@ impl Sys {
|
|||||||
},
|
},
|
||||||
ClientMsg::SetViewDistance(view_distance) => {
|
ClientMsg::SetViewDistance(view_distance) => {
|
||||||
if let ClientState::Character { .. } = client.client_state {
|
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
|
if settings
|
||||||
.max_view_distance
|
.max_view_distance
|
||||||
.map(|max| view_distance <= max)
|
.map(|max| view_distance > max)
|
||||||
.unwrap_or(true)
|
.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(
|
client.notify(ServerMsg::SetViewDistance(
|
||||||
settings.max_view_distance.unwrap_or(0),
|
settings.max_view_distance.unwrap_or(0),
|
||||||
));
|
));
|
||||||
|
Reference in New Issue
Block a user