mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Filter out empty string CLSIDs.
There's more detail in the comment, but this fixes an issue where some Mosquito loadouts could not be loaded. Might fix https://github.com/dcs-liberation/dcs_liberation/issues/3171. There aren't enough instructions in the bug for me to be sure, but it sounds like a similar problem, although I came across it with bombs rather than rockets.
This commit is contained in:
@@ -134,7 +134,17 @@ class Loadout:
|
||||
pylons = payload["pylons"]
|
||||
try:
|
||||
pylon_assignments = {
|
||||
p["num"]: Weapon.with_clsid(p["CLSID"]) for p in pylons.values()
|
||||
p["num"]: Weapon.with_clsid(p["CLSID"])
|
||||
for p in pylons.values()
|
||||
# When unloading incompatible pylons (for example, some of the
|
||||
# Mosquito's pylons cannot be loaded when other pylons are carrying
|
||||
# rockets), DCS sometimes equips the empty string rather than
|
||||
# unsetting the pylon. An unset pylon and the empty string appear to
|
||||
# have identical behavior, and it's annoying to deal with weapons
|
||||
# that pydcs doesn't know about, so just clear those pylons rather
|
||||
# than explicitly handling "".
|
||||
# https://github.com/dcs-liberation/dcs_liberation/issues/3171
|
||||
if p["CLSID"] != ""
|
||||
}
|
||||
except KeyError:
|
||||
logging.exception(
|
||||
|
||||
Reference in New Issue
Block a user