Better handling of flights with no loadouts ex. Tankers

This commit is contained in:
Eclipse/Druss99 2024-12-15 15:51:43 -05:00 committed by Raffson
parent 64d60e5ccf
commit aae4c905b9

View File

@ -314,7 +314,9 @@ class QFlightCreator(QDialog):
def _init_loadout_selector(self):
self.loadout_selector.clear()
ac_type = self.aircraft_selector.currentData()
if ac_type is None:
if ac_type is None or not any(list(Loadout.iter_for_aircraft(ac_type))):
self.loadout_selector.addItem("No loadouts available", None)
self.loadout_selector.setDisabled(True)
return
for loadout in Loadout.iter_for_aircraft(ac_type):
self.loadout_selector.addItem(loadout.name, loadout)