From 4dc619a1404e0ece2f31423931823b8b2255d43b Mon Sep 17 00:00:00 2001 From: MetalStormGhost Date: Sun, 24 Apr 2022 14:06:13 +0300 Subject: [PATCH] Changed the mod setting save/load evaluation flow in Faction to satisfy mypy. --- game/factions/faction.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/game/factions/faction.py b/game/factions/faction.py index 4bf1178f..1fa8ff59 100644 --- a/game/factions/faction.py +++ b/game/factions/faction.py @@ -288,14 +288,15 @@ class Faction: yield unit def apply_mod_settings(self, mod_settings: Optional[ModSettings] = None) -> None: - if mod_settings is None and self.mod_settings is None: - # No mod settings were provided and none were saved for this faction - # so stop here - return - elif self.mod_settings is not None: - # Saved mod settings were found for this faction, - # so load them for use - mod_settings = self.mod_settings + if mod_settings is None: + if self.mod_settings is None: + # No mod settings were provided and none were saved for this faction + # so stop here + return + elif self.mod_settings is not None: + # Saved mod settings were found for this faction, + # so load them for use + mod_settings = self.mod_settings else: # Update the mod settings of this faction # so the settings can be applied again on load, if needed