mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixes : Missing weapons names would cause flight edition window to crash while setting up default loadout UI, preventing the user from editing flights.
This commit is contained in:
parent
60af2ad0a4
commit
58d5aa9944
@ -64,23 +64,26 @@ class QPylonEditor(QComboBox):
|
|||||||
if pylon_default_weapon is not None:
|
if pylon_default_weapon is not None:
|
||||||
if self.game.settings.restrict_weapons_by_date:
|
if self.game.settings.restrict_weapons_by_date:
|
||||||
orig_weapon = Weapon.from_clsid(pylon_default_weapon)
|
orig_weapon = Weapon.from_clsid(pylon_default_weapon)
|
||||||
if not orig_weapon.available_on(self.game.date):
|
if orig_weapon is not None:
|
||||||
for fallback in orig_weapon.fallbacks:
|
if not orig_weapon.available_on(self.game.date):
|
||||||
if historical_weapon is None:
|
for fallback in orig_weapon.fallbacks:
|
||||||
if not self.pylon.can_equip(fallback):
|
if historical_weapon is None:
|
||||||
continue
|
if not self.pylon.can_equip(fallback):
|
||||||
if not fallback.available_on(self.game.date):
|
continue
|
||||||
continue
|
if not fallback.available_on(self.game.date):
|
||||||
historical_weapon = fallback
|
continue
|
||||||
|
historical_weapon = fallback
|
||||||
|
else:
|
||||||
|
historical_weapon = orig_weapon
|
||||||
|
if historical_weapon is not None:
|
||||||
|
self.setCurrentText(historical_weapon.cls_id)
|
||||||
else:
|
else:
|
||||||
historical_weapon = orig_weapon
|
self.setCurrentText(pylon_default_weapon)
|
||||||
if historical_weapon is not None:
|
|
||||||
self.setCurrentText(
|
|
||||||
weapons_data.weapon_ids.get(historical_weapon.cls_id).get(
|
|
||||||
"name"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
self.setCurrentText(
|
weapon = weapons_data.weapon_ids.get(pylon_default_weapon)
|
||||||
weapons_data.weapon_ids.get(pylon_default_weapon).get("name")
|
if weapon is not None:
|
||||||
)
|
self.setCurrentText(
|
||||||
|
weapons_data.weapon_ids.get(pylon_default_weapon).get("name")
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.setCurrentText(pylon_default_weapon)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user