Skip to content

Commit

Permalink
Properly cancel unit activities on climate change
Browse files Browse the repository at this point in the history
Closes #2460.
  • Loading branch information
lmoureaux committed Dec 23, 2024
1 parent a9b77fd commit fafe0a3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/maphand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
Expand Down

0 comments on commit fafe0a3

Please sign in to comment.