Skip to content

Commit

Permalink
fix reset replay button
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Mar 3, 2016
1 parent f253856 commit 699432f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/hotkey_handler_sp.cpp
Expand Up @@ -311,7 +311,7 @@ void playsingle_controller::hotkey_handler::load_autosave(const std::string& fil
return;
}
boost::shared_ptr<config> res(new config(savegame.child_or_empty("snapshot")));
throw reset_gamestate_exception(res);
throw reset_gamestate_exception(res, true);
}
else
{
Expand Down
6 changes: 4 additions & 2 deletions src/playsingle_controller.cpp
Expand Up @@ -203,7 +203,9 @@ void playsingle_controller::play_scenario_main_loop()
}
play_scenario_init();
replay_.reset(new replay_controller(*this, false, ex.level));
replay_->play_replay();
if(ex.start_replay) {
replay_->play_replay();
}
}
} //end for loop
}
Expand Down Expand Up @@ -661,7 +663,7 @@ void playsingle_controller::reset_replay()
{
if(replay_ && replay_->allow_reset_replay()) {
replay_->stop_replay();
throw reset_gamestate_exception(replay_->get_reset_state());
throw reset_gamestate_exception(replay_->get_reset_state(), false);
}
else {
ERR_NG << "recieved invalid reset replay\n";
Expand Down
3 changes: 2 additions & 1 deletion src/playsingle_controller.hpp
Expand Up @@ -29,8 +29,9 @@ class team;

struct reset_gamestate_exception
{
reset_gamestate_exception(boost::shared_ptr<config> l) : level(l) {}
reset_gamestate_exception(boost::shared_ptr<config> l, bool s = true) : level(l), start_replay(s) {}
boost::shared_ptr<config> level;
bool start_replay;
};

class playsingle_controller : public play_controller
Expand Down

0 comments on commit 699432f

Please sign in to comment.