mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix handling of non-AA units in AA groups.
Some units in pydcs have detection_range and threat_range defined, but explicitly set to None.
This commit is contained in:
parent
cec28351e7
commit
c4d08fa7b7
@ -176,10 +176,17 @@ class QLiberationMap(QGraphicsView):
|
|||||||
if unit is None:
|
if unit is None:
|
||||||
logging.error(f"Unknown unit type {u.type}")
|
logging.error(f"Unknown unit type {u.type}")
|
||||||
continue
|
continue
|
||||||
detection_range = max(detection_range,
|
|
||||||
getattr(unit, "detection_range"))
|
# Some units in pydcs have detection_range and threat_range
|
||||||
threat_range = max(threat_range,
|
# defined, but explicitly set to None.
|
||||||
getattr(unit, "threat_range"))
|
unit_detection_range = getattr(unit, "detection_range", None)
|
||||||
|
if unit_detection_range is not None:
|
||||||
|
detection_range = max(detection_range, unit_detection_range)
|
||||||
|
|
||||||
|
unit_threat_range = getattr(unit, "threat_range", None)
|
||||||
|
if unit_threat_range is not None:
|
||||||
|
threat_range = max(threat_range, unit_threat_range)
|
||||||
|
|
||||||
return detection_range, threat_range
|
return detection_range, threat_range
|
||||||
|
|
||||||
def reload_scene(self):
|
def reload_scene(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user