Skip to content

Commit

Permalink
remove unneeded argument in play_replay_level
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Jun 10, 2014
1 parent 2a17224 commit 703502e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/playcampaign.cpp
Expand Up @@ -189,16 +189,15 @@ LEVEL_RESULT play_replay(display& disp, game_state& gamestate, const config& gam
{
const std::string campaign_type_str = lexical_cast<std::string> (gamestate.classification().campaign_type);

// 'starting_pos' will contain the position we start the game from.
config starting_pos;

if (gamestate.replay_start().empty()){
// Backwards compatibility code for 1.2 and 1.2.1
const config &scenario = game_config.find_child(campaign_type_str,"id",gamestate.carryover_sides_start["next_scenario"]);
assert(scenario);
gamestate.replay_start() = scenario;
}
starting_pos = gamestate.replay_start();

// 'starting_pos' will contain the position we start the game from.
const config& starting_pos = gamestate.replay_start();

//for replays, use the variables specified in starting_pos
if (const config &vars = starting_pos.child("variables")) {
Expand All @@ -212,7 +211,7 @@ LEVEL_RESULT play_replay(display& disp, game_state& gamestate, const config& gam
//if (gamestate.abbrev.empty())
// gamestate.abbrev = (*scenario)["abbrev"];

LEVEL_RESULT res = play_replay_level(game_config, &starting_pos, video, gamestate, is_unit_test);
LEVEL_RESULT res = play_replay_level(game_config, video, gamestate, is_unit_test);

gamestate.snapshot = config();
recorder.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/replay_controller.cpp
Expand Up @@ -45,11 +45,11 @@ static lg::log_domain log_replay("replay");
possible_end_play_signal play_replay_level_main_loop(replay_controller & replaycontroller, bool & is_unit_test);

LEVEL_RESULT play_replay_level(const config& game_config,
const config* level, CVideo& video, game_state& state_of_game, bool is_unit_test)
CVideo& video, game_state& state_of_game, bool is_unit_test)
{
const int ticks = SDL_GetTicks();

config init_level = *level;
config init_level = state_of_game.replay_start();

DBG_NG << "creating objects... " << (SDL_GetTicks() - ticks) << std::endl;

Expand Down
3 changes: 1 addition & 2 deletions src/replay_controller.hpp
Expand Up @@ -98,8 +98,7 @@ class replay_controller : public play_controller
};


LEVEL_RESULT play_replay_level(const config& terrain_config,
const config* level, CVideo& video,
LEVEL_RESULT play_replay_level(const config& terrain_config, CVideo& video,
game_state& state_of_game, bool is_unit_test = false);

#endif

0 comments on commit 703502e

Please sign in to comment.