summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-07-17 16:01:26 +0000
committerDarkvater <Darkvater@openttd.org>2005-07-17 16:01:26 +0000
commit6a91b08cadb4fc1ba2e869adbaa1ae856b36bb70 (patch)
tree2d7b8067b8fed97f301f314b9611e6b832e05cf7 /openttd.c
parentcda6efd9194876394f6ca9d7830517e23b1f01fb (diff)
downloadopenttd-6a91b08cadb4fc1ba2e869adbaa1ae856b36bb70.tar.xz
(svn r2610) - Feature: set server map name to the loaded name of the game/scenario. Also truncate where neccessary
- Feature: truncate the path of the saveload window
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/openttd.c b/openttd.c
index 8a88789ad..8cef88613 100644
--- a/openttd.c
+++ b/openttd.c
@@ -907,12 +907,16 @@ void SwitchMode(int new_mode)
case SM_NEWGAME: /* New Game --> 'Random game' */
#ifdef ENABLE_NETWORK
if (_network_server)
- snprintf(_network_game_info.map_name, 40, "Random");
+ snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "Random Map");
#endif /* ENABLE_NETWORK */
MakeNewGame();
break;
case SM_START_SCENARIO: /* New Game --> Choose one of the preset scenarios */
+ #ifdef ENABLE_NETWORK
+ if (_network_server)
+ snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "%s (Loaded scenario)", _file_to_saveload.title);
+ #endif /* ENABLE_NETWORK */
StartScenario();
break;
@@ -928,7 +932,7 @@ void SwitchMode(int new_mode)
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
#ifdef ENABLE_NETWORK
if (_network_server)
- snprintf(_network_game_info.map_name, 40, "Loaded game");
+ snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "%s (Loaded game)", _file_to_saveload.title);
#endif /* ENABLE_NETWORK */
}
break;
@@ -950,11 +954,6 @@ void SwitchMode(int new_mode)
_generating_world = false;
// delete all stations owned by a player
DeleteAllPlayerStations();
-
-#ifdef ENABLE_NETWORK
- if (_network_server)
- snprintf(_network_game_info.map_name, 40, "Loaded scenario");
-#endif /* ENABLE_NETWORK */
} else
ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);