mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Don't plan strikes against non-strike targets.
FOB strucutres can't be repaired and the player can't target them. SAMs are targeted by DEAD already, so considering them for strike double plans the mission. Fixes https://github.com/Khopa/dcs_liberation/issues/686
This commit is contained in:
parent
bf56091dc7
commit
8dac4eca55
@ -49,6 +49,8 @@ Saves from 2.3 are not compatible with 2.4.
|
|||||||
* **[Units]** Submarines have been removed for now as they aren't wholly functional.
|
* **[Units]** Submarines have been removed for now as they aren't wholly functional.
|
||||||
* **[Units]** Fixed "FACTION ERROR : Unable to find OliverHazardPerryGroupGenerator in pydcs" error at startup.
|
* **[Units]** Fixed "FACTION ERROR : Unable to find OliverHazardPerryGroupGenerator in pydcs" error at startup.
|
||||||
* **[Flight Planner]** Fixed not being able to create custom waypoints for buildings.
|
* **[Flight Planner]** Fixed not being able to create custom waypoints for buildings.
|
||||||
|
* **[Flight Planner]** Strike missions will no longer be automatically planned against SAMs.
|
||||||
|
* **[Flight Planner]** Strike missions will no longer be automatically planned against FOB structures.
|
||||||
|
|
||||||
# 2.3.4
|
# 2.3.4
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ from game.procurement import AircraftProcurementRequest
|
|||||||
from game.theater import (
|
from game.theater import (
|
||||||
Airfield,
|
Airfield,
|
||||||
ControlPoint,
|
ControlPoint,
|
||||||
|
Fob,
|
||||||
FrontLine,
|
FrontLine,
|
||||||
MissionTarget,
|
MissionTarget,
|
||||||
OffMapSpawn,
|
OffMapSpawn,
|
||||||
@ -33,6 +34,7 @@ from game.theater import (
|
|||||||
TheaterGroundObject,
|
TheaterGroundObject,
|
||||||
)
|
)
|
||||||
from game.theater.theatergroundobject import (
|
from game.theater.theatergroundobject import (
|
||||||
|
BuildingGroundObject,
|
||||||
EwrGroundObject,
|
EwrGroundObject,
|
||||||
NavalGroundObject,
|
NavalGroundObject,
|
||||||
VehicleGroupGroundObject,
|
VehicleGroupGroundObject,
|
||||||
@ -346,12 +348,35 @@ class ObjectiveFinder:
|
|||||||
found_targets: Set[str] = set()
|
found_targets: Set[str] = set()
|
||||||
for enemy_cp in self.enemy_control_points():
|
for enemy_cp in self.enemy_control_points():
|
||||||
for ground_object in enemy_cp.ground_objects:
|
for ground_object in enemy_cp.ground_objects:
|
||||||
|
# TODO: Reuse ground_object.mission_types.
|
||||||
|
# The mission types for ground objects are currently not
|
||||||
|
# accurate because we include things like strike and BAI for all
|
||||||
|
# targets since they have different planning behavior (waypoint
|
||||||
|
# generation is better for players with strike when the targets
|
||||||
|
# are stationary, AI behavior against weaker air defenses is
|
||||||
|
# better with BAI), so that's not a useful filter. Once we have
|
||||||
|
# better control over planning profiles and target dependent
|
||||||
|
# loadouts we can clean this up.
|
||||||
if isinstance(ground_object, VehicleGroupGroundObject):
|
if isinstance(ground_object, VehicleGroupGroundObject):
|
||||||
# BAI target, not strike target.
|
# BAI target, not strike target.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(ground_object, NavalGroundObject):
|
if isinstance(ground_object, NavalGroundObject):
|
||||||
# Anti-ship target, not strike target.
|
# Anti-ship target, not strike target.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if isinstance(ground_object, SamGroundObject):
|
||||||
|
# SAMs are targeted by DEAD. No need to double plan.
|
||||||
|
continue
|
||||||
|
|
||||||
|
is_building = isinstance(ground_object, BuildingGroundObject)
|
||||||
|
is_fob = isinstance(enemy_cp, Fob)
|
||||||
|
if is_building and is_fob and ground_object.airbase_group:
|
||||||
|
# This is the FOB structure itself. Can't be repaired or
|
||||||
|
# targeted by the player, so shouldn't be targetable by the
|
||||||
|
# AI.
|
||||||
|
continue
|
||||||
|
|
||||||
if ground_object.is_dead:
|
if ground_object.is_dead:
|
||||||
continue
|
continue
|
||||||
if ground_object.name in found_targets:
|
if ground_object.name in found_targets:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user