mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Revert "Correct radar detection."
We need this after all, but we do need to audit the list. Will follow
up with that fix.
https://github.com/dcs-liberation/dcs_liberation/issues/1109
This reverts commit f68935735d.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from PySide2.QtGui import QStandardItem, QStandardItemModel
|
||||
|
||||
from game import Game
|
||||
from game.data.radar_db import UNITS_WITH_RADAR
|
||||
from gen import db
|
||||
from qt_ui.widgets.combos.QFilteredComboBox import QFilteredComboBox
|
||||
|
||||
@@ -44,18 +45,21 @@ class QSEADTargetSelectionComboBox(QFilteredComboBox):
|
||||
for g in cp.ground_objects:
|
||||
|
||||
radars = []
|
||||
max_detection_range = 0
|
||||
detection_range = 0
|
||||
threat_range = 0
|
||||
if g.dcs_identifier == "AA":
|
||||
for group in g.groups:
|
||||
for u in group.units:
|
||||
utype = db.unit_type_from_name(u.type)
|
||||
detection_range = getattr(utype, "detection_range", 0)
|
||||
if detection_range > 1000:
|
||||
max_detection_range = max(
|
||||
detection_range, max_detection_range
|
||||
)
|
||||
radars.append(u)
|
||||
|
||||
if utype in UNITS_WITH_RADAR:
|
||||
if (
|
||||
hasattr(utype, "detection_range")
|
||||
and utype.detection_range > 1000
|
||||
):
|
||||
if utype.detection_range > detection_range:
|
||||
detection_range = utype.detection_range
|
||||
radars.append(u)
|
||||
|
||||
if hasattr(utype, "threat_range"):
|
||||
if utype.threat_range > threat_range:
|
||||
@@ -77,7 +81,7 @@ class QSEADTargetSelectionComboBox(QFilteredComboBox):
|
||||
tgt_info.radars = radars
|
||||
tgt_info.location = g
|
||||
tgt_info.threat_range = threat_range
|
||||
tgt_info.detection_range = max_detection_range
|
||||
tgt_info.detection_range = detection_range
|
||||
i = add_model_item(i, model, tgt_info)
|
||||
|
||||
self.setModel(model)
|
||||
|
||||
Reference in New Issue
Block a user