fixup 'fix game freezes on droiding when using dsu #3453'

fixes https://github.com/wesnoth/wesnoth/issues/3486
This commit is contained in:
gfgtdf 2018-08-21 19:06:17 +02:00 committed by GitHub
parent 3cb6adeb69
commit 2181a56c5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -389,7 +389,7 @@ void undo_list::undo()
resources::recorder->redo(replay_data);
undos_.emplace_back(std::move(action));
}
if(std::all_of(undos_.begin(), undos_.begin(), [](const action_ptr_t& action){ return dynamic_cast<undo_action*>(action.get()) == nullptr; }))
if(std::all_of(undos_.begin(), undos_.end(), [](const action_ptr_t& action){ return dynamic_cast<undo_action*>(action.get()) == nullptr; }))
{
//clear the undo stack if it only contains dsu related actions, this in particular makes sure loops like `while(can_undo()) { undo(); }`always stop.
undos_.clear();