Don't update map if it really didn't change

This commit is contained in:
Sofia 2026-07-25 22:53:47 +03:00
parent 88e9d912a2
commit bde066af06

View File

@ -431,6 +431,9 @@ impl Game {
} }
pub fn change_map_selection(&mut self, map_idx: u8, emit: bool) { pub fn change_map_selection(&mut self, map_idx: u8, emit: bool) {
if self.selected_map_idx == map_idx {
return;
}
self.selected_map_idx = map_idx; self.selected_map_idx = map_idx;
if let Some(map) = self.maps.get(map_idx as usize) { if let Some(map) = self.maps.get(map_idx as usize) {
self.selected_map = Some(map); self.selected_map = Some(map);