Skip to content

Commit

Permalink
fix assertion failure on 'update shroud now'
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Feb 23, 2015
1 parent 8ce430d commit 256c82f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/menu_events.cpp
Expand Up @@ -791,11 +791,12 @@ void menu_handler::toggle_shroud_updates(int side_num)
team &current_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 */)
Expand Down
2 changes: 1 addition & 1 deletion src/synced_commands.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 256c82f

Please sign in to comment.