mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Include isolated points in objectivefinder
This commit is contained in:
parent
8f8ee8c48e
commit
f63939ce3c
@ -254,17 +254,20 @@ class ObjectiveFinder:
|
||||
if not c.is_friendly(self.is_player)
|
||||
)
|
||||
|
||||
def prioritized_unisolated_points(self) -> list[ControlPoint]:
|
||||
def prioritized_points(self) -> list[ControlPoint]:
|
||||
prioritized = []
|
||||
capturable_later = []
|
||||
isolated = []
|
||||
for cp in self.game.theater.control_points_for(not self.is_player):
|
||||
if cp.is_isolated:
|
||||
isolated.append(cp)
|
||||
continue
|
||||
if cp.has_active_frontline:
|
||||
prioritized.append(cp)
|
||||
else:
|
||||
capturable_later.append(cp)
|
||||
prioritized.extend(self._targets_by_range(capturable_later))
|
||||
prioritized.extend(self._targets_by_range(isolated))
|
||||
return prioritized
|
||||
|
||||
@staticmethod
|
||||
|
||||
@ -145,7 +145,7 @@ class TheaterState(WorldState["TheaterState"]):
|
||||
) -> TheaterState:
|
||||
coalition = game.coalition_for(player)
|
||||
finder = ObjectiveFinder(game, player)
|
||||
ordered_capturable_points = finder.prioritized_unisolated_points()
|
||||
ordered_capturable_points = finder.prioritized_points()
|
||||
|
||||
context = PersistentContext(
|
||||
game.db,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user