mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix detection range calculation if TGO is empty
implement fix like in #1980 solves #2128
This commit is contained in:
parent
2274cef68c
commit
ad8fef2fda
@ -192,7 +192,11 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC):
|
||||
return max_range
|
||||
|
||||
def max_detection_range(self) -> Distance:
|
||||
return max(self.detection_range(g) for g in self.groups)
|
||||
return (
|
||||
max(self.detection_range(g) for g in self.groups)
|
||||
if self.groups
|
||||
else meters(0)
|
||||
)
|
||||
|
||||
def detection_range(self, group: TheaterGroup) -> Distance:
|
||||
return self._max_range_of_type(group, "detection_range")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user