Skip to content

Commit

Permalink
Make debug commands that create units use the currently controlled side
Browse files Browse the repository at this point in the history
Instead of always creating units for side 1.
  • Loading branch information
irydacea committed May 29, 2016
1 parent 7c299ce commit 617d22e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion src/synced_commands.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit 617d22e

Please sign in to comment.