Make debug commands that create units use the currently controlled side

Instead of always creating units for side 1.
This commit is contained in:
Ignacio R. Morelle 2016-05-28 23:41:07 -04:00
parent 7c299ce418
commit 617d22e5f4
2 changed files with 7 additions and 1 deletions

View file

@ -313,6 +313,8 @@ Version 1.13.4+dev:
by other units being skipped after a unit could not get to its goal.
* Replace wmlxgettext tool with new python3 implementation by Nobun:
https://github.com/AncientLich/wmlxgettext-unoff/
* Debug commands that create units now do so for the currently controlled
side instead of always side 1.
Version 1.13.4:
* Language and i18n:

View file

@ -466,8 +466,12 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_create_unit, child, use_undo, /*show*/, e
error_handler("Invalid unit type", true);
return false;
}
const int side_num = resources::controller
? resources::controller->current_side() : 1;
// Create the unit.
unit created(*u_type, 1, true, gender);
unit created(*u_type, side_num, true, gender);
created.new_turn();
// Add the unit to the board.