Fix game break when capturing factory.

We need to recompute the transit networks after a capture *before*
processing transfers. Otherwise units deployed that turn will not be
able to find their destination.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1070
This commit is contained in:
Dan Albert 2021-05-13 21:00:13 -07:00
parent 5adcfbd7bd
commit 99dc91dcb4

View File

@ -282,6 +282,11 @@ class Game:
)
self.turn += 1
# Need to recompute before transfers and deliveries to account for captures.
# This happens in in initialize_turn as well, because cheating doesn't advance a
# turn but can capture bases so we need to recompute there as well.
self.compute_transit_networks()
# Must happen *before* unit deliveries are handled, or else new units will spawn
# one hop ahead. ControlPoint.process_turn handles unit deliveries.
self.transfers.perform_transfers()