mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Force dumping debug info on recreate.
We need a way to debug successful solvers that's still targeting to a specific flight. This will do for now.
This commit is contained in:
@@ -10,6 +10,7 @@ from game.ato.flightplans.waypointbuilder import WaypointBuilder
|
||||
from game.flightplan import JoinZoneGeometry
|
||||
from game.flightplan.ipsolver import IpSolver
|
||||
from game.flightplan.refuelzonegeometry import RefuelZoneGeometry
|
||||
from game.persistence.paths import liberation_user_dir
|
||||
from game.utils import dcs_to_shapely_point
|
||||
from game.utils import nautical_miles
|
||||
|
||||
@@ -27,16 +28,27 @@ class PackageWaypoints:
|
||||
refuel: Point
|
||||
|
||||
@staticmethod
|
||||
def create(package: Package, coalition: Coalition) -> PackageWaypoints:
|
||||
def create(
|
||||
package: Package, coalition: Coalition, dump_debug_info: bool
|
||||
) -> PackageWaypoints:
|
||||
origin = package.departure_closest_to_target()
|
||||
|
||||
waypoint_debug_directory = liberation_user_dir() / "Debug/Waypoints"
|
||||
|
||||
# Start by picking the best IP for the attack.
|
||||
ingress_point_shapely = IpSolver(
|
||||
ip_solver = IpSolver(
|
||||
dcs_to_shapely_point(origin.position),
|
||||
dcs_to_shapely_point(package.target.position),
|
||||
coalition.doctrine,
|
||||
coalition.opponent.threat_zone.all,
|
||||
).solve()
|
||||
)
|
||||
ip_solver.set_debug_properties(
|
||||
waypoint_debug_directory / "IP", coalition.game.theater.terrain
|
||||
)
|
||||
ingress_point_shapely = ip_solver.solve()
|
||||
if dump_debug_info:
|
||||
ip_solver.dump_debug_info()
|
||||
|
||||
ingress_point = origin.position.new_in_same_map(
|
||||
ingress_point_shapely.x, ingress_point_shapely.y
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user