Skip to content

Commit

Permalink
Merge pull request #800 from Wedge009/bug_25093_fix
Browse files Browse the repository at this point in the history
Resolve sides in editor not having a proper side number (bug #25093)
  • Loading branch information
CelticMinstrel committed Sep 24, 2016
2 parents b6c7273 + 43802d2 commit 99a713c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -166,6 +166,8 @@ Version 1.13.5+dev:
player opened and closed a menu.
* Correct unit recall count in statistics when undoing a unit recall (bug #25060)
* Add tip to recall units instead of recruiting them if costs exceed 20 gold (recruitment costs)
* Resolve sides in map editor not having a proper side number and subsequently
causing a crash upon editing (bug #25093)

Version 1.13.5:
* Campaigns:
Expand Down
7 changes: 5 additions & 2 deletions src/editor/map/context_manager.cpp
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/editor/map/context_manager.hpp
Expand Up @@ -133,8 +133,8 @@ class context_manager {
/** 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();
Expand Down

0 comments on commit 99a713c

Please sign in to comment.