From 99dc91dcb4678e137805106228f6210132ebc88a Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 13 May 2021 21:00:13 -0700 Subject: [PATCH] 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 --- game/game.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/game/game.py b/game/game.py index c4ac7250..4c250682 100644 --- a/game/game.py +++ b/game/game.py @@ -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()