From ad8fef2fdad2726cbad627a6ed989cf9ed43f946 Mon Sep 17 00:00:00 2001 From: RndName Date: Fri, 1 Apr 2022 11:54:47 +0200 Subject: [PATCH] Fix detection range calculation if TGO is empty implement fix like in #1980 solves #2128 --- game/theater/theatergroundobject.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game/theater/theatergroundobject.py b/game/theater/theatergroundobject.py index 926bbe82..ce1fe54d 100644 --- a/game/theater/theatergroundobject.py +++ b/game/theater/theatergroundobject.py @@ -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")