mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Type check the contents of untyped functions.
By default mypy doesn't type check the code within an untyped function. This enables that and fixes typing errors to accomodate it. This did uncover a very old bug: https://github.com/dcs-liberation/dcs_liberation/issues/1417
This commit is contained in:
10
gen/armor.py
10
gen/armor.py
@@ -136,6 +136,7 @@ class GroundConflictGenerator:
|
||||
position = Conflict.frontline_position(
|
||||
self.conflict.front_line, self.game.theater
|
||||
)
|
||||
|
||||
frontline_vector = Conflict.frontline_vector(
|
||||
self.conflict.front_line, self.game.theater
|
||||
)
|
||||
@@ -150,6 +151,13 @@ class GroundConflictGenerator:
|
||||
self.enemy_planned_combat_groups, frontline_vector, False
|
||||
)
|
||||
|
||||
# TODO: Differentiate AirConflict and GroundConflict classes.
|
||||
if self.conflict.heading is None:
|
||||
raise RuntimeError(
|
||||
"Cannot generate ground units for non-ground conflict. Ground unit "
|
||||
"conflicts cannot have the heading `None`."
|
||||
)
|
||||
|
||||
# Plan combat actions for groups
|
||||
self.plan_action_for_groups(
|
||||
self.player_stance,
|
||||
@@ -174,7 +182,7 @@ class GroundConflictGenerator:
|
||||
code = 1688 - len(self.jtacs)
|
||||
|
||||
utype = self.game.player_faction.jtac_unit
|
||||
if self.game.player_faction.jtac_unit is None:
|
||||
if utype is None:
|
||||
utype = AircraftType.named("MQ-9 Reaper")
|
||||
|
||||
jtac = self.mission.flight_group(
|
||||
|
||||
Reference in New Issue
Block a user