From 1cd9894a24186450f5f8eb2f48ba5732ae2d53ae Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Wed, 2 May 2018 20:37:27 +0200 Subject: [PATCH] wb: fix crash when using planning mode mode with dsu fixes #1599 . we now automaticllay disable dsu when enabling planning mode (cherry-picked from commit 4f161d889c87f610a565347656fd1695b60b1208) --- src/whiteboard/manager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/whiteboard/manager.cpp b/src/whiteboard/manager.cpp index 6d94c52c00ae..609a02ab920b 100644 --- a/src/whiteboard/manager.cpp +++ b/src/whiteboard/manager.cpp @@ -43,7 +43,9 @@ #include "key.hpp" #include "pathfind/pathfind.hpp" #include "play_controller.hpp" +#include "replay_helper.hpp" #include "resources.hpp" +#include "synced_context.hpp" #include "team.hpp" #include "units/unit.hpp" #include "units/animation_component.hpp" @@ -181,8 +183,13 @@ void manager::set_active(bool active) if (active_) { - if(should_clear_undo()) + if(should_clear_undo()) { + if(!resources::controller->current_team().auto_shroud_updates()) { + synced_context::run_and_throw("update_shroud", replay_helper::get_update_shroud()); + synced_context::run_and_throw("auto_shroud", replay_helper::get_auto_shroud(true)); + } resources::undo_stack->clear(); + } validate_viewer_actions(); LOG_WB << "Whiteboard activated! " << *viewer_actions() << "\n"; create_temp_move(); @@ -1077,7 +1084,7 @@ int manager::get_spent_gold_for(int side) bool manager::should_clear_undo() const { - return resources::controller->is_networked_mp(); + return resources::controller->is_networked_mp() && resources::controller->current_team().is_local(); } void manager::options_dlg()