|
|
@ -343,10 +343,18 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
|
|
|
|
|
|
|
|
|
|
|
|
df::unit *unit = Gui::getSelectedUnit(out, true);
|
|
|
|
df::unit *unit = Gui::getSelectedUnit(out, true);
|
|
|
|
if (!unit)
|
|
|
|
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");
|
|
|
|
out.printerr("No unit selected!\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
return CR_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!Maps::IsValid())
|
|
|
|
if (!Maps::IsValid())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
out.printerr("Map is not available.\n");
|
|
|
|
out.printerr("Map is not available.\n");
|
|
|
|