mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix crash on view distance change related to borrows
Former-commit-id: 0cfa022e0078b077f3bd128fc6f51d03898722ef
This commit is contained in:
parent
894b4339ca
commit
3e49c37a08
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
hud::{Event as HudEvent, Hud},
|
||||
hud::{DebugInfo, Event as HudEvent, Hud},
|
||||
key_state::KeyState,
|
||||
render::Renderer,
|
||||
scene::Scene,
|
||||
@ -176,12 +176,16 @@ impl PlayState for SessionState {
|
||||
&self.client.borrow_mut(),
|
||||
);
|
||||
|
||||
// Maintain the UI.
|
||||
for event in self.hud.maintain(
|
||||
// extract HUD events ensuring the client borrow gets dropped
|
||||
let hud_events = self.hud.maintain(
|
||||
global_state,
|
||||
clock.get_tps(),
|
||||
self.client.borrow().get_ping_ms(),
|
||||
) {
|
||||
DebugInfo {
|
||||
tps: clock.get_tps(),
|
||||
ping_ms: self.client.borrow().get_ping_ms(),
|
||||
},
|
||||
);
|
||||
// Maintain the UI.
|
||||
for event in hud_events {
|
||||
match event {
|
||||
HudEvent::SendMessage(msg) => {
|
||||
// TODO: Handle result
|
||||
|
Loading…
Reference in New Issue
Block a user