| 1339 | } |
| 1340 | |
| 1341 | static bool ConRestart(std::span<std::string_view> argv) |
| 1342 | { |
| 1343 | if (argv.empty() || argv.size() > 2) { |
| 1344 | IConsolePrint(CC_HELP, "Restart game. Usage: 'restart [current|newgame]'."); |
| 1345 | IConsolePrint(CC_HELP, "Restarts a game, using either the current or newgame (default) settings."); |
| 1346 | IConsolePrint(CC_HELP, " * if you started from a new game, and your current/newgame settings haven't changed, the game will be identical to when you started it."); |
| 1347 | IConsolePrint(CC_HELP, " * if you started from a savegame / scenario / heightmap, the game might be different, because the current/newgame settings might differ."); |
| 1348 | return true; |
| 1349 | } |
| 1350 | |
| 1351 | if (argv.size() == 1 || std::string_view(argv[1]) == "newgame") { |
| 1352 | StartNewGameWithoutGUI(_settings_game.game_creation.generation_seed); |
| 1353 | } else { |
| 1354 | _settings_game.game_creation.map_x = Map::LogX(); |
| 1355 | _settings_game.game_creation.map_y = Map::LogY(); |
| 1356 | _switch_mode = SM_RESTARTGAME; |
| 1357 | } |
| 1358 | |
| 1359 | return true; |
| 1360 | } |
| 1361 | |
| 1362 | static bool ConReload(std::span<std::string_view> argv) |
| 1363 | { |
nothing calls this directly
no test coverage detected