Add: "restart current" console command to regenerate the map based on current settings (#11963)

This commit is contained in:
Patric Stout
2024-02-03 15:48:54 +01:00
committed by GitHub
parent 17d02ed45f
commit 0dfba564ab
3 changed files with 22 additions and 10 deletions

View File

@@ -1049,7 +1049,7 @@ void SwitchToMode(SwitchMode new_mode)
if (new_mode != SM_SAVE_GAME) {
/* If the network is active, make it not-active */
if (_networking) {
if (_network_server && (new_mode == SM_LOAD_GAME || new_mode == SM_NEWGAME)) {
if (_network_server && (new_mode == SM_LOAD_GAME || new_mode == SM_NEWGAME || new_mode == SM_RESTARTGAME)) {
NetworkReboot();
} else {
NetworkDisconnect();
@@ -1113,6 +1113,7 @@ void SwitchToMode(SwitchMode new_mode)
UpdateSocialIntegration(GM_NORMAL);
break;
case SM_RESTARTGAME: // Restart --> 'Random game' with current settings
case SM_NEWGAME: // New Game --> 'Random game'
MakeNewGame(false, new_mode == SM_NEWGAME);
GenerateSavegameId();