1
0
Fork 0

(svn r1061) -Fix: [Network] Compiling without ENABLE_NETWORK now works again correctly

release/0.4.5
truelight 2004-12-13 17:58:53 +00:00
parent 9ced62e239
commit 2e7f669153
2 changed files with 8 additions and 0 deletions

View File

@ -398,6 +398,7 @@ static void PlayersCheckBankrupt(Player *p)
} else { } else {
// If we are the server, make sure it is clear that his player is no // If we are the server, make sure it is clear that his player is no
// longer with us! // longer with us!
#ifdef ENABLE_NETWORK
if (IS_HUMAN_PLAYER(owner) && _network_server) { if (IS_HUMAN_PLAYER(owner) && _network_server) {
NetworkClientInfo *ci; NetworkClientInfo *ci;
ci = NetworkFindClientInfoFromIndex(_network_own_client_index); ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
@ -405,6 +406,7 @@ static void PlayersCheckBankrupt(Player *p)
// Send the new info to all the clients // Send the new info to all the clients
NetworkUpdateClientInfo(_network_own_client_index); NetworkUpdateClientInfo(_network_own_client_index);
} }
#endif /* ENABLE_NETWORK */
// Make sure the player no longer controls the company // Make sure the player no longer controls the company
if (IS_HUMAN_PLAYER(owner) && owner == _local_player) { if (IS_HUMAN_PLAYER(owner) && owner == _local_player) {
// Switch the player to spectator.. // Switch the player to spectator..

6
ttd.c
View File

@ -868,8 +868,10 @@ void SwitchMode(int new_mode)
break; break;
case SM_NEWGAME: case SM_NEWGAME:
#ifdef ENABLE_NETWORK
if (_network_server) if (_network_server)
snprintf(_network_game_info.map_name, 40, "Random"); snprintf(_network_game_info.map_name, 40, "Random");
#endif /* ENABLE_NETWORK */
MakeNewGame(); MakeNewGame();
break; break;
@ -887,8 +889,10 @@ normal_load:
_opt_mod_ptr = &_opt; _opt_mod_ptr = &_opt;
_local_player = 0; _local_player = 0;
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
#ifdef ENABLE_NETWORK
if (_network_server) if (_network_server)
snprintf(_network_game_info.map_name, 40, "Loaded game"); snprintf(_network_game_info.map_name, 40, "Loaded game");
#endif /* ENABLE_NETWORK */
} }
break; break;
} }
@ -912,8 +916,10 @@ normal_load:
// delete all stations owned by a player // delete all stations owned by a player
DeleteAllPlayerStations(); DeleteAllPlayerStations();
#ifdef ENABLE_NETWORK
if (_network_server) if (_network_server)
snprintf(_network_game_info.map_name, 40, "Loaded scenario"); snprintf(_network_game_info.map_name, 40, "Loaded scenario");
#endif /* ENABLE_NETWORK */
} else } else
ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0); ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);