Skip to content

Commit

Permalink
fixup scenario advancing
Browse files Browse the repository at this point in the history
the "gamestate().remove_snapshot();" is unneded and would undo the
"gamestate().set_snapshot();" in playcampaign
  • Loading branch information
gfgtdf committed Jun 15, 2014
1 parent ee7ab9b commit dd7dca9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/saved_game.hpp
Expand Up @@ -55,6 +55,7 @@ class saved_game

config& get_starting_pos();
config& replay_start() { return replay_start_; }
const config& replay_start() const { return replay_start_; }
/**
* If the game is saved mid-level, we have a series of replay steps
* to take the game up to the position it was saved at.
Expand Down
2 changes: 1 addition & 1 deletion src/savegame.cpp
Expand Up @@ -653,8 +653,8 @@ void replay_savegame::create_filename()
}

void replay_savegame::write_game(config_writer &out) {
gamestate().remove_snapshot();
savegame::write_game(out);

gamestate().write_carryover(out);
out.write_child("replay_start", gamestate().replay_start());
out.write_child("replay", gamestate().replay_data);
Expand Down
4 changes: 2 additions & 2 deletions src/savegame.hpp
Expand Up @@ -131,7 +131,7 @@ class savegame
void set_error_message(const std::string& error_message) { error_message_ = error_message; }

const std::string& title() { return title_; }
saved_game& gamestate() { return gamestate_; }
const saved_game& gamestate() { return gamestate_; }
config& snapshot() { return snapshot_; }

/** If there needs to be some data fiddling before saving the game, this is the place to go. */
Expand Down Expand Up @@ -161,7 +161,7 @@ class savegame
/** Throws game::save_game_failed. */
scoped_ostream open_save_game(const std::string &label);
friend class save_info;

//before_save (write replay data) changes this so it cannot be const
saved_game& gamestate_;

/** Gamestate information at the time of saving. Note that this object is needed here, since
Expand Down

0 comments on commit dd7dca9

Please sign in to comment.