Commandline: Encapsulate skip_story in play_controller

(cherry-picked from commit 1d1d26035091108e33ea8af57754ba520ec27d35)
This commit is contained in:
josteph 2018-09-07 15:01:50 +00:00 committed by loonycyborg
parent d443df9be1
commit a8bded63ad
3 changed files with 5 additions and 1 deletions

View File

@ -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_()

View File

@ -188,6 +188,8 @@ 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;
@ -341,6 +343,7 @@ protected:
std::unique_ptr<replay> replay_;
bool skip_replay_;
bool skip_story_;
bool linger_;
/**
* Whether we did init sides in this session

View File

@ -228,7 +228,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;