Skip to content

Commit

Permalink
wb: fix crash when using planning mode mode with dsu
Browse files Browse the repository at this point in the history
fixes #1599 . we now automaticllay disable dsu when enabling planning mode
  • Loading branch information
gfgtdf authored and Vultraz committed May 3, 2018
1 parent 2174bfc commit 4f161d8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/whiteboard/manager.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1066,7 +1073,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()
Expand Down

0 comments on commit 4f161d8

Please sign in to comment.