mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix #1968: refactor missing_plugins check for better performance
This commit is contained in:
parent
b2d7a9291a
commit
13a3c53307
@ -3248,8 +3248,8 @@ impl Client {
|
||||
self.missing_plugins.len()
|
||||
}
|
||||
|
||||
/// number of requested plugins
|
||||
pub fn num_missing_plugins(&self) -> usize { self.missing_plugins.len() }
|
||||
/// true if missing_plugins is not empty
|
||||
pub fn are_plugins_missing(&self) -> bool { !self.missing_plugins.is_empty() }
|
||||
|
||||
/// extract list of locally cached plugins to load
|
||||
pub fn take_local_plugins(&mut self) -> Vec<PathBuf> { std::mem::take(&mut self.local_plugins) }
|
||||
|
@ -71,7 +71,7 @@ impl CharSelectionState {
|
||||
impl PlayState for CharSelectionState {
|
||||
fn enter(&mut self, global_state: &mut GlobalState, _: Direction) {
|
||||
// Load the player's character list
|
||||
if self.client.borrow().num_missing_plugins() == 0 {
|
||||
if !self.client.borrow().are_plugins_missing() {
|
||||
self.client.borrow_mut().load_character_list();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user