Changeset - r630:6ed61836c69a
[Not reviewed]
master
0 2 0
truelight - 19 years ago 2004-12-13 17:58:53
truelight@openttd.org
(svn r1061) -Fix: [Network] Compiling without ENABLE_NETWORK now works again correctly
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
economy.c
Show inline comments
 
@@ -395,19 +395,21 @@ static void PlayersCheckBankrupt(Player 
 
			if (IS_HUMAN_PLAYER(owner) && !_networking) {
 
				p->bankrupt_asked = 255;
 
				p->bankrupt_timeout = 0x456;
 
			} else {
 
				// If we are the server, make sure it is clear that his player is no
 
				//  longer with us!
 
#ifdef ENABLE_NETWORK
 
				if (IS_HUMAN_PLAYER(owner) && _network_server) {
 
					NetworkClientInfo *ci;
 
					ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
 
					ci->client_playas = (byte)(OWNER_SPECTATOR + 1);
 
					// Send the new info to all the clients
 
					NetworkUpdateClientInfo(_network_own_client_index);
 
				}
 
#endif /* ENABLE_NETWORK */
 
				// Make sure the player no longer controls the company
 
				if (IS_HUMAN_PLAYER(owner) && owner == _local_player) {
 
					// Switch the player to spectator..
 
					_local_player = OWNER_SPECTATOR;
 
				}
 
				// Convert everything the player owns to NO_OWNER
ttd.c
Show inline comments
 
@@ -865,14 +865,16 @@ void SwitchMode(int new_mode)
 
	switch(new_mode) {
 
	case SM_EDITOR: // Switch to scenario editor
 
		MakeNewEditorWorld();
 
		break;
 

	
 
	case SM_NEWGAME:
 
#ifdef ENABLE_NETWORK
 
		if (_network_server)
 
			snprintf(_network_game_info.map_name, 40, "Random");
 
#endif /* ENABLE_NETWORK */
 
		MakeNewGame();
 
		break;
 

	
 
	case SM_START_SCENARIO:
 
		StartScenario();
 
		break;
 
@@ -884,14 +886,16 @@ normal_load:
 
		if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL)) {
 
			ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
 
		} else {
 
			_opt_mod_ptr = &_opt;
 
			_local_player = 0;
 
			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");
 
#endif /* ENABLE_NETWORK */
 
		}
 
		break;
 
	}
 

	
 
	case SM_LOAD_SCENARIO: {
 
		int i;
 
@@ -909,14 +913,16 @@ normal_load:
 
				_players[i].is_active = false;
 
			}
 
			_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);
 

	
 
		break;
 
	}
 

	
0 comments (0 inline, 0 general)