mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
AI Strike flight with user generated STRIKE, will now perform their bombing task correctly.
This commit is contained in:
parent
0b9d827ad6
commit
02886a09d3
@ -455,15 +455,18 @@ class AircraftConflictGenerator:
|
|||||||
group.points[0].tasks.append(OptRestrictJettison(True))
|
group.points[0].tasks.append(OptRestrictJettison(True))
|
||||||
|
|
||||||
i = 1
|
i = 1
|
||||||
|
bombing_point_found = False
|
||||||
for point in flight.points:
|
for point in flight.points:
|
||||||
group.add_waypoint(Point(point.x,point.y), point.alt)
|
group.add_waypoint(Point(point.x,point.y), point.alt)
|
||||||
for t in point.targets:
|
if not bombing_point_found:
|
||||||
if hasattr(t, "obj_name"):
|
for t in point.targets:
|
||||||
buildings = self.game.theater.find_ground_objects_by_obj_name(t.obj_name)
|
if hasattr(t, "obj_name"):
|
||||||
for building in buildings:
|
buildings = self.game.theater.find_ground_objects_by_obj_name(t.obj_name)
|
||||||
group.points[i].tasks.append(Bombing(building.position))
|
for building in buildings:
|
||||||
else:
|
group.points[i].tasks.append(Bombing(building.position))
|
||||||
group.points[i].tasks.append(Bombing(t.position))
|
else:
|
||||||
|
group.points[i].tasks.append(Bombing(t.position))
|
||||||
|
bombing_point_found = True
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -333,7 +333,7 @@ class FlightPlanner:
|
|||||||
point = FlightWaypoint(u.position.x, u.position.y, 0)
|
point = FlightWaypoint(u.position.x, u.position.y, 0)
|
||||||
point.description = "STRIKE " + "[" + str(location.obj_name) + "] : " + u.type + " #" + str(j)
|
point.description = "STRIKE " + "[" + str(location.obj_name) + "] : " + u.type + " #" + str(j)
|
||||||
point.pretty_name = "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)
|
flight.points.append(point)
|
||||||
else:
|
else:
|
||||||
point = FlightWaypoint(location.position.x, location.position.y, 0)
|
point = FlightWaypoint(location.position.x, location.position.y, 0)
|
||||||
|
|||||||
@ -105,6 +105,7 @@ class QPredefinedWaypointSelectionComboBox(QComboBox):
|
|||||||
wpt.name = wpt.name = "[" + str(ground_object.obj_name) + "] : " + ground_object.category + " #" + str(ground_object.object_id)
|
wpt.name = wpt.name = "[" + str(ground_object.obj_name) + "] : " + ground_object.category + " #" + str(ground_object.object_id)
|
||||||
wpt.pretty_name = wpt.name
|
wpt.pretty_name = wpt.name
|
||||||
wpt.obj_name = ground_object.obj_name
|
wpt.obj_name = ground_object.obj_name
|
||||||
|
wpt.targets.append(ground_object)
|
||||||
if cp.captured:
|
if cp.captured:
|
||||||
wpt.description = "Friendly Building"
|
wpt.description = "Friendly Building"
|
||||||
else:
|
else:
|
||||||
@ -120,6 +121,7 @@ class QPredefinedWaypointSelectionComboBox(QComboBox):
|
|||||||
wpt = FlightWaypoint(u.position.x, u.position.y, 0)
|
wpt = FlightWaypoint(u.position.x, u.position.y, 0)
|
||||||
wpt.name = wpt.name = "[" + str(ground_object.obj_name) + "] : " + u.type + " #" + str(j)
|
wpt.name = wpt.name = "[" + str(ground_object.obj_name) + "] : " + u.type + " #" + str(j)
|
||||||
wpt.pretty_name = wpt.name
|
wpt.pretty_name = wpt.name
|
||||||
|
wpt.targets.append(u)
|
||||||
wpt.obj_name = ground_object.obj_name
|
wpt.obj_name = ground_object.obj_name
|
||||||
if cp.captured:
|
if cp.captured:
|
||||||
wpt.description = "Friendly unit : " + u.type
|
wpt.description = "Friendly unit : " + u.type
|
||||||
|
|||||||
@ -262,22 +262,22 @@ def generate_cp_ground_points(cp: ControlPoint, theater, game, group_id, templat
|
|||||||
g.group_id = group_id
|
g.group_id = group_id
|
||||||
g.object_id = object_id
|
g.object_id = object_id
|
||||||
g.cp_id = cp.id
|
g.cp_id = cp.id
|
||||||
g.airbase_gorup = False
|
g.airbase_group = False
|
||||||
g.obj_name = obj_name
|
g.obj_name = obj_name
|
||||||
|
|
||||||
g.dcs_identifier = object["type"]
|
g.dcs_identifier = object["type"]
|
||||||
g.heading = object["heading"]
|
g.heading = object["heading"]
|
||||||
g.position = Point(point.x + object["offset"].x, point.y + object["offset"].y)
|
g.position = Point(point.x + object["offset"].x, point.y + object["offset"].y)
|
||||||
|
|
||||||
if g.dcs_identifier == "AA":
|
#if g.dcs_identifier == "AA":
|
||||||
if cp.captured:
|
# if cp.captured:
|
||||||
faction = game.player_name
|
# faction = game.player_name
|
||||||
else:
|
# else:
|
||||||
faction = game.enemy_name
|
# faction = game.enemy_name
|
||||||
g.groups = []
|
# g.groups = []
|
||||||
group = generate_anti_air_group(game, cp, g, faction)
|
# group = generate_anti_air_group(game, cp, g, faction)
|
||||||
if group is not None:
|
# if group is not None:
|
||||||
g.groups.append(group)
|
# g.groups.append(group)
|
||||||
|
|
||||||
cp.ground_objects.append(g)
|
cp.ground_objects.append(g)
|
||||||
return group_id
|
return group_id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user