From 762bc328e12e74824c1b4984ba6b6ebfd96aa2c0 Mon Sep 17 00:00:00 2001 From: RndName Date: Sat, 26 Feb 2022 22:31:01 +0100 Subject: [PATCH] Fix SA-8 LD used incorrectly as SA-13 and cleanup - The SA-8 LD unit hat the SA-13 unit name as variant. The Layout tried to create a SA-13 SHORAD Site but actually used an SA-8 LD unit instead with zero threat range. This resulted in a yellow marked GroundObject on the map - Cleaned up the treat and radar range functions a bit --- qt_ui/widgets/map/model/groundobjectjs.py | 16 ++-------------- .../units/ground_units/SA-8 Osa LD 9T217.yaml | 6 +++--- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/qt_ui/widgets/map/model/groundobjectjs.py b/qt_ui/widgets/map/model/groundobjectjs.py index 8cb3ba91..09d4bd44 100644 --- a/qt_ui/widgets/map/model/groundobjectjs.py +++ b/qt_ui/widgets/map/model/groundobjectjs.py @@ -76,22 +76,10 @@ class GroundObjectJs(QObject): def samThreatRanges(self) -> List[float]: if not self.tgo.might_have_aa: return [] - - ranges = [] - for group in self.tgo.groups: - threat_range = self.tgo.threat_range(group) - if threat_range: - ranges.append(threat_range.meters) - return ranges + return [self.tgo.threat_range(group).meters for group in self.tgo.groups] @Property(list, notify=samDetectionRangesChanged) def samDetectionRanges(self) -> List[float]: if not self.tgo.might_have_aa: return [] - - ranges = [] - for group in self.tgo.groups: - detection_range = self.tgo.detection_range(group) - if detection_range: - ranges.append(detection_range.meters) - return ranges + return [self.tgo.detection_range(group).meters for group in self.tgo.groups] diff --git a/resources/units/ground_units/SA-8 Osa LD 9T217.yaml b/resources/units/ground_units/SA-8 Osa LD 9T217.yaml index c972963e..fbb8b048 100644 --- a/resources/units/ground_units/SA-8 Osa LD 9T217.yaml +++ b/resources/units/ground_units/SA-8 Osa LD 9T217.yaml @@ -1,4 +1,4 @@ -class: SHORAD +class: Logistics description: "The 9K33 Osa (Russian: 9\u041A33 \xAB\u041E\u0441\u0430\xBB, literally\ \ \"wasp\"; NATO reporting name SA-8 Gecko) is a highly mobile, low-altitude, short-range\ \ tactical surface-to-air missile system developed in the Soviet Union in the 1960s\ @@ -6,7 +6,7 @@ description: "The 9K33 Osa (Russian: 9\u041A33 \xAB\u041E\u0441\u0430\xBB, liter introduced: 1981 manufacturer: Ulyanovsk origin: USSR/Russia -price: 22 +price: 3 role: Self-Propelled Surface-to-Air Missile Launcher variants: - SA-13 Gopher (9K35 Strela-10M3): {} + SAM SA-8 Osa LD 9T217: {}