mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix chunk loading delay
Former-commit-id: b287ab5be22ae6e4d0b10b5010e592a7a514cacb
This commit is contained in:
parent
f5751d65b1
commit
e34a47d0d7
@ -137,6 +137,13 @@ impl Client {
|
||||
&mut self.state
|
||||
}
|
||||
|
||||
/// Remove all cached terrain
|
||||
#[allow(dead_code)]
|
||||
pub fn reset_terrain(&mut self) {
|
||||
self.state.terrain_mut().clear();
|
||||
self.pending_chunks.clear();
|
||||
}
|
||||
|
||||
/// Get the player's entity.
|
||||
#[allow(dead_code)]
|
||||
pub fn entity(&self) -> EcsEntity {
|
||||
@ -394,7 +401,7 @@ impl Client {
|
||||
self.pending_state_request = false;
|
||||
}
|
||||
ServerMsg::ForceState(state) => {
|
||||
self.client_state = Some(dbg!(state));
|
||||
self.client_state = Some(state);
|
||||
}
|
||||
ServerMsg::Disconnect => {
|
||||
self.client_state = None;
|
||||
|
@ -45,7 +45,7 @@ impl PlayState for CharSelectionState {
|
||||
fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult {
|
||||
// Set up an fps clock.
|
||||
let mut clock = Clock::new();
|
||||
self.client.borrow_mut().state_mut().terrain_mut().clear();
|
||||
self.client.borrow_mut().reset_terrain();
|
||||
|
||||
while self.client.borrow().is_request_pending()
|
||||
|| self.client.borrow().get_client_state() == Some(ClientState::Registered)
|
||||
|
@ -115,7 +115,7 @@ impl PlayState for SessionState {
|
||||
|
||||
// Set up an fps clock.
|
||||
let mut clock = Clock::new();
|
||||
self.client.borrow_mut().state_mut().terrain_mut().clear();
|
||||
self.client.borrow_mut().reset_terrain();
|
||||
|
||||
// Load a few chunks. TODO: Remove this.
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user