Skip to content

Commit

Permalink
fix crash when using planning mode mode with dsu
Browse files Browse the repository at this point in the history
fixes wesnoth#1599 . we now automaticllay disable dsu when enabling planning mode
  • Loading branch information
gfgtdf committed May 2, 2018
1 parent 3618c89 commit 9f029b4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/whiteboard/manager.cpp
Original file line number Diff line number Diff line change
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 @@ -1078,8 +1085,8 @@ int manager::get_spent_gold_for(int side)
}

bool manager::should_clear_undo() const
{
return resources::controller->is_networked_mp();
{66
return resources::controller->is_networked_mp() && resources::controller->current_team().is_local();
}

void manager::options_dlg()
Expand Down

0 comments on commit 9f029b4

Please sign in to comment.