mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'fotkurz/plugin-bookkeepingoptimization' into 'master'
Fix #1968: refactor missing_plugins check for better performance Closes #1968 See merge request veloren/veloren!4463
This commit is contained in:
commit
246d90cf22
@ -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