From 229008577be03e425e84f8c1a7ec062dea8fcdc5 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 8 Sep 2022 14:06:39 -0700 Subject: [PATCH] Load airfield data when called for airport. The for_theater method is always called before for_airport is during normal gameplay, but I'm writing a linter to show missing airfield data that calls for_airport first. --- game/airfields.py | 1 + resources/tools/datalint.py | 0 2 files changed, 1 insertion(+) create mode 100644 resources/tools/datalint.py diff --git a/game/airfields.py b/game/airfields.py index fba49b73..b3b918b0 100644 --- a/game/airfields.py +++ b/game/airfields.py @@ -179,6 +179,7 @@ class AirfieldData: @classmethod def for_airport(cls, theater: ConflictTheater, airport: Airport) -> AirfieldData: + cls._load_for_theater_if_needed(theater) return cls._airfields[theater.terrain.name][airport.id] @classmethod diff --git a/resources/tools/datalint.py b/resources/tools/datalint.py new file mode 100644 index 00000000..e69de29b