mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
AI Strike flight with user generated STRIKE, will now perform their bombing task correctly.
This commit is contained in:
@@ -455,15 +455,18 @@ class AircraftConflictGenerator:
|
||||
group.points[0].tasks.append(OptRestrictJettison(True))
|
||||
|
||||
i = 1
|
||||
bombing_point_found = False
|
||||
for point in flight.points:
|
||||
group.add_waypoint(Point(point.x,point.y), point.alt)
|
||||
for t in point.targets:
|
||||
if hasattr(t, "obj_name"):
|
||||
buildings = self.game.theater.find_ground_objects_by_obj_name(t.obj_name)
|
||||
for building in buildings:
|
||||
group.points[i].tasks.append(Bombing(building.position))
|
||||
else:
|
||||
group.points[i].tasks.append(Bombing(t.position))
|
||||
if not bombing_point_found:
|
||||
for t in point.targets:
|
||||
if hasattr(t, "obj_name"):
|
||||
buildings = self.game.theater.find_ground_objects_by_obj_name(t.obj_name)
|
||||
for building in buildings:
|
||||
group.points[i].tasks.append(Bombing(building.position))
|
||||
else:
|
||||
group.points[i].tasks.append(Bombing(t.position))
|
||||
bombing_point_found = True
|
||||
i = i + 1
|
||||
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ class FlightPlanner:
|
||||
point = FlightWaypoint(u.position.x, u.position.y, 0)
|
||||
point.description = "STRIKE " + "[" + str(location.obj_name) + "] : " + u.type + " #" + str(j)
|
||||
point.pretty_name = "STRIKE " + "[" + str(location.obj_name) + "] : " + u.type + " #" + str(j)
|
||||
point.targets.append(location)
|
||||
ingress_point.targets.append(location)
|
||||
flight.points.append(point)
|
||||
else:
|
||||
point = FlightWaypoint(location.position.x, location.position.y, 0)
|
||||
|
||||
Reference in New Issue
Block a user