From f608cd5aefee9661b5e69ad30d7768605f190002 Mon Sep 17 00:00:00 2001 From: walterroach <37820425+walterroach@users.noreply.github.com> Date: Sat, 12 Dec 2020 15:45:55 -0600 Subject: [PATCH] fix mypy issues --- game/theater/conflicttheater.py | 2 ++ gen/armor.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/game/theater/conflicttheater.py b/game/theater/conflicttheater.py index b7760a04..cb66d792 100644 --- a/game/theater/conflicttheater.py +++ b/game/theater/conflicttheater.py @@ -482,6 +482,8 @@ class ConflictTheater: return point point = geometry.Point(point.x, point.y) nearest_points = [] + if not self.landmap: + raise RuntimeError("Landmap not initialized") for inclusion_zone in self.landmap[0]: nearest_pair = ops.nearest_points(point, inclusion_zone) nearest_points.append(nearest_pair[1]) diff --git a/gen/armor.py b/gen/armor.py index f8c92d2c..f5fde0a5 100644 --- a/gen/armor.py +++ b/gen/armor.py @@ -183,7 +183,9 @@ class GroundConflictGenerator: forward_heading, self.conflict.theater ) - + if not infantry_position: + logging.warning("Could not find infantry position") + return if side == self.conflict.attackers_country: cp = self.conflict.from_cp else: @@ -610,7 +612,7 @@ class GroundConflictGenerator: self, conflict_position: Point, combat_width: int, - distance_from_frontline: int, + distance_from_frontline: Tuple[int, int], heading: int, spawn_heading: int ):