mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Special case turn 0 for recruitment.
We want there to be units on the front line on turn 1 regardless of factory locations, so bypass the recruitment restrictions on turn 0. https://github.com/Khopa/dcs_liberation/issues/986
This commit is contained in:
parent
d11c9a4615
commit
30bf4542f0
@ -540,6 +540,12 @@ class UnitsDeliveryEvent:
|
||||
)
|
||||
|
||||
def find_ground_unit_source(self, game: Game) -> Optional[ControlPoint]:
|
||||
# This is running *after* the turn counter has been incremented, so this is the
|
||||
# reaction to turn 0. On turn zero we allow units to be recruited anywhere for
|
||||
# delivery on turn 1 so that turn 1 always starts with units on the front line.
|
||||
if game.turn == 1:
|
||||
return self.destination
|
||||
|
||||
# Fast path if the destination is a valid source.
|
||||
if self.destination.can_recruit_ground_units(game):
|
||||
return self.destination
|
||||
|
||||
@ -329,6 +329,11 @@ class ControlPoint(MissionTarget, ABC):
|
||||
if not game.settings.enable_new_ground_unit_recruitment:
|
||||
return True
|
||||
|
||||
if game.turn == 0:
|
||||
# Allow units to be recruited anywhere on turn 0 to avoid long delays to get
|
||||
# everyone to the front line.
|
||||
return True
|
||||
|
||||
return self.has_factory
|
||||
|
||||
def has_ground_unit_source(self, game: Game) -> bool:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user