From 5a245bf362a510355a53692a297e59cf19bc1bc1 Mon Sep 17 00:00:00 2001 From: Khopa Date: Mon, 12 Oct 2020 18:53:15 +0200 Subject: [PATCH] Fixed crash in polygon display mode for Nevada map. --- qt_ui/widgets/map/QLiberationMap.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/qt_ui/widgets/map/QLiberationMap.py b/qt_ui/widgets/map/QLiberationMap.py index ea0cee56..cd61d310 100644 --- a/qt_ui/widgets/map/QLiberationMap.py +++ b/qt_ui/widgets/map/QLiberationMap.py @@ -494,12 +494,14 @@ class QLiberationMap(QGraphicsView): else: # Polygon display mode - for inclusion_zone in self.game.theater.landmap[0]: - poly = QPolygonF([QPointF(*self._transform_point(Point(point[0], point[1]))) for point in inclusion_zone]) - scene.addPolygon(poly, CONST.COLORS["grey"], CONST.COLORS["dark_grey"]) + if self.game.theater.landmap is not None: - for exclusion_zone in self.game.theater.landmap[1]: - poly = QPolygonF([QPointF(*self._transform_point(Point(point[0], point[1]))) for point in exclusion_zone]) - scene.addPolygon(poly, CONST.COLORS["grey"], CONST.COLORS["dark_dark_grey"]) + for inclusion_zone in self.game.theater.landmap[0]: + poly = QPolygonF([QPointF(*self._transform_point(Point(point[0], point[1]))) for point in inclusion_zone]) + scene.addPolygon(poly, CONST.COLORS["grey"], CONST.COLORS["dark_grey"]) + + for exclusion_zone in self.game.theater.landmap[1]: + poly = QPolygonF([QPointF(*self._transform_point(Point(point[0], point[1]))) for point in exclusion_zone]) + scene.addPolygon(poly, CONST.COLORS["grey"], CONST.COLORS["dark_dark_grey"])