From f1adcd18364db78f400b00bd0e5c54f43b299023 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 19 May 2021 23:33:24 -0700 Subject: [PATCH] Be permissive about presumably incorrect loadouts. These might be broken loadouts, or might be broken pydcs data. In case it's the latter, attempt to load the pylon. DCS will remove the weapon if it's not compatible automatically. --- game/data/weapons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/data/weapons.py b/game/data/weapons.py index 38133fe0..9b6d8e0c 100644 --- a/game/data/weapons.py +++ b/game/data/weapons.py @@ -85,7 +85,7 @@ class Pylon: def equip(self, group: FlyingGroup, weapon: Weapon) -> None: if not self.can_equip(weapon): - raise ValueError(f"Pylon {self.number} cannot equip {weapon.name}") + logging.error(f"Pylon {self.number} cannot equip {weapon.name}") group.load_pylon(self.make_pydcs_assignment(weapon), self.number) def make_pydcs_assignment(self, weapon: Weapon) -> PydcsWeaponAssignment: