From a63bac88261f72929c4a3b9aaf514c9a9fb74168 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 9 Nov 2020 21:51:55 -0800 Subject: [PATCH] Don't display scud sites as SAM threat range. --- qt_ui/widgets/map/QLiberationMap.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qt_ui/widgets/map/QLiberationMap.py b/qt_ui/widgets/map/QLiberationMap.py index bca8e766..5834ba6f 100644 --- a/qt_ui/widgets/map/QLiberationMap.py +++ b/qt_ui/widgets/map/QLiberationMap.py @@ -39,7 +39,11 @@ from qt_ui.widgets.map.QMapControlPoint import QMapControlPoint from qt_ui.widgets.map.QMapGroundObject import QMapGroundObject from qt_ui.windows.GameUpdateSignal import GameUpdateSignal from theater import ControlPoint, FrontLine -from theater.theatergroundobject import EwrGroundObject, TheaterGroundObject +from theater.theatergroundobject import ( + EwrGroundObject, + MissileSiteGroundObject, + TheaterGroundObject, +) class QLiberationMap(QGraphicsView): @@ -229,13 +233,15 @@ class QLiberationMap(QGraphicsView): buildings = self.game.theater.find_ground_objects_by_obj_name(ground_object.obj_name) scene.addItem(QMapGroundObject(self, go_pos[0], go_pos[1], 14, 12, cp, ground_object, self.game, buildings)) + is_missile = isinstance(ground_object, MissileSiteGroundObject) + is_aa = ground_object.category == "aa" and not is_missile is_ewr = isinstance(ground_object, EwrGroundObject) - is_aa = ground_object.category == "aa" or is_ewr + is_display_type = is_aa or is_ewr should_display = ((DisplayOptions.sam_ranges and cp.captured) or (DisplayOptions.enemy_sam_ranges and not cp.captured)) - if is_aa and should_display: + if is_display_type and should_display: detection_range, threat_range = self.aa_ranges( ground_object )