mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix planning error in CAP-builder if no enemy airfields left
This commit is contained in:
parent
7ea144e7c7
commit
164873d3b1
@ -35,7 +35,12 @@ class CapBuilder(IBuilder[FlightPlanT, LayoutT], ABC):
|
|||||||
closest_airfield = airfield
|
closest_airfield = airfield
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise PlanningError("Could not find any enemy airfields")
|
for airfield in closest_cache.closest_airfields:
|
||||||
|
if airfield.captured != self.is_player:
|
||||||
|
closest_airfield = airfield
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise PlanningError("Could not find any enemy airfields")
|
||||||
|
|
||||||
heading = Heading.from_degrees(
|
heading = Heading.from_degrees(
|
||||||
location.position.heading_between_point(closest_airfield.position)
|
location.position.heading_between_point(closest_airfield.position)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user