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 authored and loonycyborg committed Sep 21, 2018
1 parent f7be872 commit 1d1d260
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,
, 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 @@ -242,6 +242,8 @@ class play_controller : public controller_base, public events::observer, public

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 @@ -451,6 +453,7 @@ class play_controller : public controller_base, public events::observer, public
std::unique_ptr<replay> replay_;

bool skip_replay_;
bool skip_story_;
bool linger_;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/playsingle_controller.cpp
Expand Up @@ -227,7 +227,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 1d1d260

Please sign in to comment.