diff --git a/src/menu_events.cpp b/src/menu_events.cpp index 9ccb7f2df53a..8d9634791651 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -791,11 +791,12 @@ void menu_handler::toggle_shroud_updates(int side_num) team ¤t_team = teams()[side_num - 1]; bool auto_shroud = current_team.auto_shroud_updates(); // If we're turning automatic shroud updates on, then commit all moves + // TODO: currently synced_context::run_in_synced_context("auto_shroud", replay_helper::get_auto_shroud(!auto_shroud)); + // Also calls update_shroud_now so eigher remove this one or that one. if (!auto_shroud) update_shroud_now(side_num); // Toggle the setting and record this. synced_context::run_in_synced_context("auto_shroud", replay_helper::get_auto_shroud(!auto_shroud)); - pc_.get_undo_stack().add_auto_shroud(!auto_shroud); } void menu_handler::update_shroud_now(int /* side_num */) diff --git a/src/synced_commands.cpp b/src/synced_commands.cpp index 66bc8141a5fd..02e9481e39d8 100644 --- a/src/synced_commands.cpp +++ b/src/synced_commands.cpp @@ -345,8 +345,8 @@ SYNCED_COMMAND_HANDLER_FUNCTION(auto_shroud, child, use_undo, /*show*/, /*error // Turning on automatic shroud causes vision to be updated. if ( active ) resources::undo_stack->commit_vision(); - current_team.set_auto_shroud_updates(active); + resources::undo_stack->add_auto_shroud(active); return true; }