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!
This commit is contained in:
Raffson 2022-09-04 12:26:09 +02:00
parent 9a0e8c9e4b
commit 87c75aa61e
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -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)),