Skip to content

Commit

Permalink
Commandline: Encapsulate skip_story in play_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
jostephd committed Sep 20, 2018
1 parent 9b5d5a6 commit 7951dc2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/play_controller.cpp
Expand Up @@ -153,6 +153,7 @@ play_controller::play_controller(const config& level, saved_game& state_of_game,
, statistics_context_(new statistics::scenario_context(level["name"]))
, replay_(new replay(state_of_game.get_replay()))
, skip_replay_(skip_replay)
, skip_story_(state_of_game.skip_story())
, linger_(false)
, init_side_done_now_(false)
, map_start_()
Expand Down
3 changes: 3 additions & 0 deletions src/play_controller.hpp
Expand Up @@ -189,6 +189,8 @@ class play_controller : public controller_base, public events::observer, public
bool is_linger_mode() const { return linger_; }
void do_autosave();

bool is_skipping_story() const { return skip_story_; }

void do_consolesave(const std::string& filename);

events::mouse_handler& get_mouse_handler_base() override;
Expand Down Expand Up @@ -339,6 +341,7 @@ class play_controller : public controller_base, public events::observer, public
std::unique_ptr<replay> replay_;

bool skip_replay_;
bool skip_story_;
bool linger_;
/**
* Whether we did init sides in this session
Expand Down
2 changes: 1 addition & 1 deletion src/playsingle_controller.cpp
Expand Up @@ -229,7 +229,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const config& level)
}
sound::commit_music_changes();

if(!this->is_skipping_replay() && !saved_game_.skip_story()) {
if(!this->is_skipping_replay() && !this->is_skipping_story()) {
// Combine all the [story] tags into a single config. Handle this here since
// storyscreen::controller doesn't have a default constructor.
config cfg;
Expand Down

0 comments on commit 7951dc2

Please sign in to comment.