Resolve sides in editor not having a proper side number (bug #25093)

This commit is contained in:
Wedge009 2016-09-24 19:31:10 +10:00
parent b6c7273fb5
commit c8bef84820
2 changed files with 7 additions and 4 deletions

View file

@ -207,15 +207,18 @@ void context_manager::load_mru_item(unsigned int index, bool force_same_context
load_map(mru[index], !force_same_context);
}
void context_manager::edit_side_dialog(int side)
void context_manager::edit_side_dialog(int side_index)
{
team& t = get_map_context().get_teams()[side];
team& t = get_map_context().get_teams()[side_index];
//TODO
//t.support()
editor_team_info team_info(t);
// The side number perhaps should have been set in map_context::new_side() but the design of team::team_info appears to be read-only.
team_info.side = side_index + 1; // note team_info::side is supposed to be 1 to n, while side/team indexes are 0 to n-1
if(gui2::teditor_edit_side::execute(team_info, gui_.video())) {
get_map_context().set_side_setup(team_info);
}

View file

@ -133,8 +133,8 @@ public:
/** Display a scenario edit dialog and process user input. */
void edit_scenario_dialog();
/** TODO */
void edit_side_dialog(int side);
/** Display a side edit dialog and process user input. */
void edit_side_dialog(int side_index);
/** Display a new map dialog and process user input. */
void new_map_dialog();