From 87c75aa61ef9e05aa9860db63e1d2c0b9ab73248 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 4 Sep 2022 12:26:09 +0200 Subject: [PATCH] Import DaytimeMap locally Causes an exception otherwise, and at the same time a perfect example why a strongly typed language would be better in this case, because this would've been caught by a compiler! --- game/weather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game/weather.py b/game/weather.py index 24361cd6..f6192c24 100644 --- a/game/weather.py +++ b/game/weather.py @@ -15,7 +15,7 @@ from game.utils import Distance, Heading, Pressure, inches_hg, interpolate, mete if TYPE_CHECKING: from game.settings import Settings - from game.theater import ConflictTheater, DaytimeMap + from game.theater import ConflictTheater from game.theater.seasonalconditions import SeasonalConditions @@ -323,6 +323,8 @@ class Conditions: night_disabled: bool, ) -> datetime.datetime: if night_disabled: + from game.theater import DaytimeMap + logging.info("Skip Night mission due to user settings") time_range = DaytimeMap( dawn=(datetime.time(hour=8), datetime.time(hour=9)),