Skip to content

Commit

Permalink
Fix crash from side not being reset in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyeh authored and Pentarctagon committed Oct 31, 2020
1 parent caf8911 commit f8794a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/editor/map/context_manager.cpp
Expand Up @@ -102,6 +102,11 @@ void context_manager::refresh_on_context_change()
resources::tod_manager = get_map_context().get_time_manager();
resources::classification = &get_map_context().get_classification();

// Reset side when switching to an existing scenario
if (gui().get_teams().size() > 0) {
gui().set_team(0, true);
gui().set_playing_team(0);
}
gui().init_flags();

reload_map();
Expand Down Expand Up @@ -970,6 +975,8 @@ void context_manager::new_scenario(int width, int height, const t_translation::t

// Give the new scenario an initial side.
get_map_context().new_side();
gui().set_team(0, true);
gui().set_playing_team(0);
gui_.init_flags();
}

Expand Down

0 comments on commit f8794a0

Please sign in to comment.