Merge pull request #5595 from mattsc/undo_assert
Fix potential crash when running commands in synced context
This commit is contained in:
commit
152e18b9d6
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
|||
* So far the use of 'subjective info' is stubbed out.
|
||||
*/
|
||||
|
||||
#include "actions/undo.hpp"
|
||||
#include "ai/actions.hpp"
|
||||
#include "ai/manager.hpp"
|
||||
#include "ai/simulated_actions.hpp"
|
||||
|
@ -654,6 +655,7 @@ void recall_result::do_execute()
|
|||
// Do the actual recalling.
|
||||
// We ignore possible errors (=unit doesn't exist on the recall list)
|
||||
// because that was the previous behavior.
|
||||
resources::undo_stack->clear();
|
||||
synced_context::run_in_synced_context_if_not_already("recall",
|
||||
replay_helper::get_recall(unit_id_, recall_location_, recall_from_),
|
||||
false,
|
||||
|
@ -802,6 +804,7 @@ void recruit_result::do_execute()
|
|||
return;
|
||||
}
|
||||
|
||||
resources::undo_stack->clear();
|
||||
synced_context::run_in_synced_context_if_not_already("recruit", replay_helper::get_recruit(u->id(), recruit_location_, recruit_from_), false, !preferences::skip_ai_moves());
|
||||
|
||||
set_gamestate_changed();
|
||||
|
|
Loading…
Add table
Reference in a new issue