mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix now obvious reversal of convoy friendliness.
Convoy attack and shipping attacks were being planned against *only* friendly targets. The renaming made the bug obvious.
This commit is contained in:
parent
b0c24f6e51
commit
67289bbba2
@ -925,6 +925,11 @@ class FrontLine(MissionTarget):
|
|||||||
self._build_segments()
|
self._build_segments()
|
||||||
self.name = f"Front line {blue_point}/{red_point}"
|
self.name = f"Front line {blue_point}/{red_point}"
|
||||||
|
|
||||||
|
def control_point_hostile_to(self, player: bool) -> ControlPoint:
|
||||||
|
if player:
|
||||||
|
return self.red_cp
|
||||||
|
return self.blue_cp
|
||||||
|
|
||||||
def is_friendly(self, to_player: bool) -> bool:
|
def is_friendly(self, to_player: bool) -> bool:
|
||||||
"""Returns True if the objective is in friendly territory."""
|
"""Returns True if the objective is in friendly territory."""
|
||||||
return False
|
return False
|
||||||
|
|||||||
@ -441,21 +441,15 @@ class ObjectiveFinder:
|
|||||||
|
|
||||||
def convoys(self) -> Iterator[Convoy]:
|
def convoys(self) -> Iterator[Convoy]:
|
||||||
for front_line in self.front_lines():
|
for front_line in self.front_lines():
|
||||||
if front_line.blue_cp.is_friendly(self.is_player):
|
yield from self.game.transfers.convoys.travelling_to(
|
||||||
enemy_cp = front_line.blue_cp
|
front_line.control_point_hostile_to(self.is_player)
|
||||||
else:
|
)
|
||||||
enemy_cp = front_line.red_cp
|
|
||||||
|
|
||||||
yield from self.game.transfers.convoys.travelling_to(enemy_cp)
|
|
||||||
|
|
||||||
def cargo_ships(self) -> Iterator[CargoShip]:
|
def cargo_ships(self) -> Iterator[CargoShip]:
|
||||||
for front_line in self.front_lines():
|
for front_line in self.front_lines():
|
||||||
if front_line.blue_cp.is_friendly(self.is_player):
|
yield from self.game.transfers.cargo_ships.travelling_to(
|
||||||
enemy_cp = front_line.blue_cp
|
front_line.control_point_hostile_to(self.is_player)
|
||||||
else:
|
)
|
||||||
enemy_cp = front_line.red_cp
|
|
||||||
|
|
||||||
yield from self.game.transfers.cargo_ships.travelling_to(enemy_cp)
|
|
||||||
|
|
||||||
def friendly_control_points(self) -> Iterator[ControlPoint]:
|
def friendly_control_points(self) -> Iterator[ControlPoint]:
|
||||||
"""Iterates over all friendly control points."""
|
"""Iterates over all friendly control points."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user