fix mypy issues

This commit is contained in:
walterroach 2020-12-12 15:45:55 -06:00
parent 0371b62acb
commit f608cd5aef
2 changed files with 6 additions and 2 deletions

View File

@ -482,6 +482,8 @@ class ConflictTheater:
return point return point
point = geometry.Point(point.x, point.y) point = geometry.Point(point.x, point.y)
nearest_points = [] nearest_points = []
if not self.landmap:
raise RuntimeError("Landmap not initialized")
for inclusion_zone in self.landmap[0]: for inclusion_zone in self.landmap[0]:
nearest_pair = ops.nearest_points(point, inclusion_zone) nearest_pair = ops.nearest_points(point, inclusion_zone)
nearest_points.append(nearest_pair[1]) nearest_points.append(nearest_pair[1])

View File

@ -183,7 +183,9 @@ class GroundConflictGenerator:
forward_heading, forward_heading,
self.conflict.theater self.conflict.theater
) )
if not infantry_position:
logging.warning("Could not find infantry position")
return
if side == self.conflict.attackers_country: if side == self.conflict.attackers_country:
cp = self.conflict.from_cp cp = self.conflict.from_cp
else: else:
@ -610,7 +612,7 @@ class GroundConflictGenerator:
self, self,
conflict_position: Point, conflict_position: Point,
combat_width: int, combat_width: int,
distance_from_frontline: int, distance_from_frontline: Tuple[int, int],
heading: int, heading: int,
spawn_heading: int spawn_heading: int
): ):