From 6a91b08cadb4fc1ba2e869adbaa1ae856b36bb70 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sun, 17 Jul 2005 16:01:26 +0000 Subject: (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 --- openttd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'openttd.c') 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); -- cgit v1.2.3-54-g00ecf