Fix A-10A payload bug leading to uneditable flight

This commit is contained in:
Raffson 2024-03-22 18:41:36 +01:00
parent 36ef246fcd
commit a7d65866e8
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 10 additions and 5 deletions

View File

@ -4,6 +4,7 @@
## Features/Improvements
## Fixes
* **[UI/UX]** A-10A flights can be edited again.
# Retribution v1.3.1

View File

@ -137,11 +137,15 @@ class Loadout:
continue
name = payload["name"]
pylons = payload["pylons"]
yield Loadout(
name,
{p["num"]: Weapon.with_clsid(p["CLSID"]) for p in pylons.values()},
date=None,
)
try:
yield Loadout(
name,
{p["num"]: Weapon.with_clsid(p["CLSID"]) for p in pylons.values()},
date=None,
)
except KeyError:
# invalid loadout
continue
@staticmethod
def valid_payload(pylons: Dict[int, Dict[str, str]]) -> bool: