parent
ba3f4129fe
commit
a8da5e2b6d
2 changed files with 7 additions and 2 deletions
|
@ -150,8 +150,6 @@ gui::dialog_button_action::RESULT delete_recall_unit::button_pressed(int menu_se
|
|||
|
||||
// Remove the item from filter_textbox memory
|
||||
filter_.delete_item(menu_selection);
|
||||
//add dismissal to the undo stack
|
||||
resources::undo_stack->add_dismissal(u_ptr);
|
||||
|
||||
LOG_DP << "Dismissing a unit, side = " << u.side() << " id = '" << u.id() << "'\n";
|
||||
LOG_DP << "That side's recall list:\n";
|
||||
|
|
|
@ -232,6 +232,13 @@ SYNCED_COMMAND_HANDLER_FUNCTION(disband, child, /*use_undo*/, /*show*/, error_ha
|
|||
|
||||
const std::string& unit_id = child["value"];
|
||||
size_t old_size = current_team.recall_list().size();
|
||||
|
||||
// Find the unit in the recall list.
|
||||
unit_ptr dismissed_unit = current_team.recall_list().find_if_matches_id(unit_id);
|
||||
assert(dismissed_unit);
|
||||
//add dismissal to the undo stack
|
||||
resources::undo_stack->add_dismissal(dismissed_unit);
|
||||
|
||||
current_team.recall_list().erase_if_matches_id(unit_id);
|
||||
|
||||
if (old_size == current_team.recall_list().size()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue