From 2bb1c0b3f26dd7923ddc74a7a4af7652f3c0f1cf Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 22 Jun 2021 23:41:05 -0700 Subject: [PATCH] Fixed missed initialization of unit data on load. We'd only load unit data if a name lookup was done and missed it on a type lookup. Ideally we wouldn't need to do a type lookup here until the ground unit templates are reworked we still do. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1299 (cherry picked from commit d3d655da0716f37dcfd8bbcc9f901417dcb540e6) --- game/dcs/groundunittype.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/dcs/groundunittype.py b/game/dcs/groundunittype.py index ff03702d..7cf92fcf 100644 --- a/game/dcs/groundunittype.py +++ b/game/dcs/groundunittype.py @@ -45,6 +45,8 @@ class GroundUnitType(UnitType[VehicleType]): @classmethod def for_dcs_type(cls, dcs_unit_type: Type[VehicleType]) -> Iterator[GroundUnitType]: + if not cls._loaded: + cls._load_all() yield from cls._by_unit_type[dcs_unit_type] @staticmethod