|
|
@ -113,7 +113,7 @@ DFhackCExport command_result mode (Core * c, vector <string> & parameters)
|
|
|
|
printCurrentModes(gm, c->con);
|
|
|
|
printCurrentModes(gm, c->con);
|
|
|
|
if(set)
|
|
|
|
if(set)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(gm.g_mode == GAMEMODE_NONE || gm.g_type == GAMETYPE_VIEW_LEGENDS || gm.g_type == GAMETYPE_DWARF_RECLAIM)
|
|
|
|
if( gm.g_mode == GAMEMODE_NONE || gm.g_type == GAMETYPE_VIEW_LEGENDS )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
c->con.printerr("It is not safe to set modes in menus.\n");
|
|
|
|
c->con.printerr("It is not safe to set modes in menus.\n");
|
|
|
|
return CR_FAILURE;
|
|
|
|
return CR_FAILURE;
|
|
|
@ -123,6 +123,7 @@ DFhackCExport command_result mode (Core * c, vector <string> & parameters)
|
|
|
|
<< "1 = Adventurer Mode" << endl
|
|
|
|
<< "1 = Adventurer Mode" << endl
|
|
|
|
<< "2 = Arena Mode" << endl
|
|
|
|
<< "2 = Arena Mode" << endl
|
|
|
|
<< "3 = Arena, controlling creature" << endl
|
|
|
|
<< "3 = Arena, controlling creature" << endl
|
|
|
|
|
|
|
|
<< "4 = Reclaim Fortress Mode" << endl
|
|
|
|
<< "c = cancel/do nothing" << endl;
|
|
|
|
<< "c = cancel/do nothing" << endl;
|
|
|
|
uint32_t select=99;
|
|
|
|
uint32_t select=99;
|
|
|
|
|
|
|
|
|
|
|
@ -135,7 +136,7 @@ DFhackCExport command_result mode (Core * c, vector <string> & parameters)
|
|
|
|
const char * start = selected.c_str();
|
|
|
|
const char * start = selected.c_str();
|
|
|
|
char * end = 0;
|
|
|
|
char * end = 0;
|
|
|
|
select = strtol(start, &end, 10);
|
|
|
|
select = strtol(start, &end, 10);
|
|
|
|
if(!end || end==start || select > 3)
|
|
|
|
if(!end || end==start || select > 4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
c->con.printerr("This is not a valid selection.\n");
|
|
|
|
c->con.printerr("This is not a valid selection.\n");
|
|
|
|
goto input_again;
|
|
|
|
goto input_again;
|
|
|
@ -159,6 +160,10 @@ DFhackCExport command_result mode (Core * c, vector <string> & parameters)
|
|
|
|
gm.g_mode = GAMEMODE_ADVENTURE;
|
|
|
|
gm.g_mode = GAMEMODE_ADVENTURE;
|
|
|
|
gm.g_type = GAMETYPE_ADVENTURE_ARENA;
|
|
|
|
gm.g_type = GAMETYPE_ADVENTURE_ARENA;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
|
|
gm.g_mode = GAMEMODE_DWARF;
|
|
|
|
|
|
|
|
gm.g_type = GAMETYPE_DWARF_RECLAIM;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
c->Suspend();
|
|
|
|
c->Suspend();
|
|
|
|
world->WriteGameMode(gm);
|
|
|
|
world->WriteGameMode(gm);
|
|
|
|