Make createitem default to the controlled unit in adventure mode.

develop
Alexander Gavrilov 2014-03-24 19:35:34 +04:00
parent 6e338d96e9
commit 827dd121d8
2 changed files with 11 additions and 2 deletions

@ -11,6 +11,7 @@ DFHack future
- digfort: improved csv parsing, add start() comment handling
- exterminate: allow specifying a caste (exterminate gob:male)
- siege-engine: engine quality and distance to target now affect accuracy.
- createitem: in adventure mode it now defaults to the controlled unit as maker.
DFHack v0.34.11-r4

@ -343,10 +343,18 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
df::unit *unit = Gui::getSelectedUnit(out, true);
if (!unit)
{
if (*gametype == game_type::ADVENTURE_ARENA || *gametype == game_type::ADVENTURE_MAIN)
{
// Use the adventurer unit
unit = world->units.active[0];
}
else
{
out.printerr("No unit selected!\n");
return CR_FAILURE;
}
}
if (!Maps::IsValid())
{
out.printerr("Map is not available.\n");