mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Tolerate empty TGOs in max_threat_range.
This commit is contained in:
parent
205929bfc9
commit
3231d008cc
@ -173,7 +173,9 @@ class TheaterGroundObject(MissionTarget, Generic[GroupT]):
|
|||||||
return self._max_range_of_type(group, "detection_range")
|
return self._max_range_of_type(group, "detection_range")
|
||||||
|
|
||||||
def max_threat_range(self) -> Distance:
|
def max_threat_range(self) -> Distance:
|
||||||
return max(self.threat_range(g) for g in self.groups)
|
return (
|
||||||
|
max(self.threat_range(g) for g in self.groups) if self.groups else meters(0)
|
||||||
|
)
|
||||||
|
|
||||||
def threat_range(self, group: GroupT, radar_only: bool = False) -> Distance:
|
def threat_range(self, group: GroupT, radar_only: bool = False) -> Distance:
|
||||||
return self._max_range_of_type(group, "threat_range")
|
return self._max_range_of_type(group, "threat_range")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user