From fafe0a35f56f092c0a7b8bcf46e1f03004b8eb4c Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Mon, 23 Dec 2024 04:50:08 +0100 Subject: [PATCH] Properly cancel unit activities on climate change Closes #2460. --- server/maphand.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/maphand.cpp b/server/maphand.cpp index 23b0d2d556..747599d981 100644 --- a/server/maphand.cpp +++ b/server/maphand.cpp @@ -199,13 +199,12 @@ void climate_change(bool warming, int effect) update_tile_knowledge(ptile); // Check the unit activities. - unit_list_iterate(ptile->units, punit) + unit_activities_cancel_all_illegal(ptile); + adjc_iterate(&(wld.map), ptile, n_tile) { - if (!can_unit_continue_current_activity(punit)) { - unit_activity_handling(punit, ACTIVITY_IDLE); - } + unit_activities_cancel_all_illegal(n_tile); } - unit_list_iterate_end; + adjc_iterate_end; } else if (old == tnew) { // This counts toward a climate change although nothing is changed. effect--;