Skip to content

Commit

Permalink
fix bug #22123 by resetting map, rebuilding screen on replay reset
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 2, 2014
1 parent 0a001ea commit c40b0fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/replay_controller.cpp
Expand Up @@ -75,6 +75,7 @@ replay_controller::replay_controller(const config& level,
teams_start_(teams_),
gamestate_start_(gamestate_),
units_start_(units_),
gamemap_start_(map_),
tod_manager_start_(level, num_turns),
current_turn_(1),
is_playing_(false),
Expand Down Expand Up @@ -269,8 +270,14 @@ void replay_controller::reset_replay()
recorder.start_replay();
recorder.set_skip(false);
units_ = units_start_;
map_ = gamemap_start_;
gamestate_ = gamestate_start_;
teams_ = teams_start_;

resources::screen->recalculate_minimap();
resources::screen->invalidate_all();
resources::screen->rebuild_all();

if (events_manager_ ){
// NOTE: this double reset is required so that the new
// instance of game_events::manager isn't created before the
Expand Down
1 change: 1 addition & 0 deletions src/replay_controller.hpp
Expand Up @@ -86,6 +86,7 @@ class replay_controller : public play_controller

game_state gamestate_start_;
unit_map units_start_;
gamemap gamemap_start_;
tod_manager tod_manager_start_;

unsigned int current_turn_;
Expand Down

0 comments on commit c40b0fc

Please sign in to comment.