mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix targeting of carrier groups with TGOs.
The assumption that the first group is the carrier group is wrong. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1346
This commit is contained in:
parent
cb7c075a61
commit
80cf8f484d
@ -27,8 +27,9 @@ from game.theater import (
|
|||||||
MissionTarget,
|
MissionTarget,
|
||||||
SamGroundObject,
|
SamGroundObject,
|
||||||
TheaterGroundObject,
|
TheaterGroundObject,
|
||||||
|
NavalControlPoint,
|
||||||
)
|
)
|
||||||
from game.theater.theatergroundobject import EwrGroundObject
|
from game.theater.theatergroundobject import EwrGroundObject, NavalGroundObject
|
||||||
from game.utils import Distance, Speed, feet, meters, nautical_miles, knots
|
from game.utils import Distance, Speed, feet, meters, nautical_miles, knots
|
||||||
from .closestairfields import ObjectiveDistanceCache
|
from .closestairfields import ObjectiveDistanceCache
|
||||||
from .flight import Flight, FlightType, FlightWaypoint, FlightWaypointType
|
from .flight import Flight, FlightType, FlightWaypoint, FlightWaypointType
|
||||||
@ -1146,12 +1147,9 @@ class FlightPlanBuilder:
|
|||||||
|
|
||||||
from game.transfers import CargoShip
|
from game.transfers import CargoShip
|
||||||
|
|
||||||
if isinstance(location, ControlPoint):
|
if isinstance(location, NavalControlPoint):
|
||||||
if not location.is_fleet:
|
targets = self.anti_ship_targets_for_tgo(location.find_main_tgo())
|
||||||
raise InvalidObjectiveLocation(flight.flight_type, location)
|
elif isinstance(location, NavalGroundObject):
|
||||||
# The first group generated will be the carrier group itself.
|
|
||||||
targets = self.anti_ship_targets_for_tgo(location.ground_objects[0])
|
|
||||||
elif isinstance(location, TheaterGroundObject):
|
|
||||||
targets = self.anti_ship_targets_for_tgo(location)
|
targets = self.anti_ship_targets_for_tgo(location)
|
||||||
elif isinstance(location, CargoShip):
|
elif isinstance(location, CargoShip):
|
||||||
targets = [StrikeTarget(location.name, location)]
|
targets = [StrikeTarget(location.name, location)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user