Changeset - r24695:05e093ea8aec
[Not reviewed]
master
0 8 0
glx22 - 4 years ago 2021-01-22 15:24:29
glx@openttd.org
Change: Apply some consistency to singleplayer related comments
8 files changed with 12 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -882,7 +882,7 @@ CommandCost CmdCompanyCtrl(TileIndex til
 
			CompanyRemoveReason reason = (CompanyRemoveReason)GB(p1, 24, 8);
 
			if (reason >= CRR_END) return CMD_ERROR;
 

	
 
			/* We can't delete the last existing company in offline mode. */
 
			/* We can't delete the last existing company in singleplayer mode. */
 
			if (!_networking && Company::GetNumItems() == 1) return CMD_ERROR;
 

	
 
			Company *c = Company::GetIfValid(company_id);
src/console_cmds.cpp
Show inline comments
 
@@ -147,7 +147,7 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
 
}
 

	
 
/**
 
 * Check whether we are in single player mode.
 
 * Check whether we are in singleplayer mode.
 
 * @return True when no network is active.
 
 */
 
DEF_CONSOLE_HOOK(ConHookNoNetwork)
 
@@ -1248,7 +1248,7 @@ DEF_CONSOLE_CMD(ConReloadAI)
 
		return true;
 
	}
 

	
 
	/* In offline mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
 
	/* In singleplayer mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
 
	if (Company::IsHumanID(company_id) || company_id == _local_company) {
 
		IConsoleWarning("Company is not controlled by an AI.");
 
		return true;
 
@@ -1286,7 +1286,7 @@ DEF_CONSOLE_CMD(ConStopAI)
 
		return true;
 
	}
 

	
 
	/* In offline mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
 
	/* In singleplayer mode the player can be in an AI company, after cheating or loading network save with an AI in first slot. */
 
	if (Company::IsHumanID(company_id) || company_id == _local_company) {
 
		IConsoleWarning("Company is not controlled by an AI.");
 
		return true;
src/economy.cpp
Show inline comments
 
@@ -289,7 +289,7 @@ void ChangeOwnershipOfCompanyItems(Owner
 
	if (_networking) NetworkClientsToSpectators(old_owner);
 
	if (old_owner == _local_company) {
 
		/* Single player cheated to AI company.
 
		 * There are no spectators in single player, so we must pick some other company. */
 
		 * There are no spectators in singleplayer mode, so we must pick some other company. */
 
		assert(!_networking);
 
		Backup<CompanyID> cur_company2(_current_company, FILE_LINE);
 
		for (const Company *c : Company::Iterate()) {
 
@@ -605,7 +605,7 @@ static void CompanyCheckBankrupt(Company
 
		default:
 
		case 10: {
 
			if (!_networking && _local_company == c->index) {
 
				/* If we are in offline mode, leave the company playing. Eg. there
 
				/* If we are in singleplayer mode, leave the company playing. Eg. there
 
				 * is no THE-END, otherwise mark the client as spectator to make sure
 
				 * he/she is no long in control of this company. However... when you
 
				 * join another company (cheat) the "unowned" company can bankrupt. */
 
@@ -2114,7 +2114,7 @@ CommandCost CmdBuyCompany(TileIndex tile
 
	/* Disable takeovers when not asked */
 
	if (!HasBit(c->bankrupt_asked, _current_company)) return CMD_ERROR;
 

	
 
	/* Disable taking over the local company in single player */
 
	/* Disable taking over the local company in singleplayer mode */
 
	if (!_networking && _local_company == c->index) return CMD_ERROR;
 

	
 
	/* Do not allow companies to take over themselves */
src/highscore_gui.cpp
Show inline comments
 
@@ -113,7 +113,7 @@ struct EndGameWindow : EndGameHighScoreB
 
			this->window_number = SP_MULTIPLAYER;
 
			this->rank = SaveHighScoreValueNetwork();
 
		} else {
 
			/* in single player _local company is always valid */
 
			/* in singleplayer mode _local company is always valid */
 
			const Company *c = Company::Get(_local_company);
 
			this->window_number = SP_CUSTOM;
 
			this->rank = SaveHighScoreValue(c);
src/main_gui.cpp
Show inline comments
 
@@ -313,7 +313,7 @@ struct MainWindow : Window
 
				break;
 

	
 
			case GHK_MONEY: // Gimme money
 
				/* You can only cheat for money in single player. */
 
				/* You can only cheat for money in singleplayer mode. */
 
				if (!_networking) DoCommandP(0, 10000000, 0, CMD_MONEY_CHEAT);
 
				break;
 

	
src/network/network_command.cpp
Show inline comments
 
@@ -298,7 +298,7 @@ const char *NetworkGameSocketHandler::Re
 
	cp->company = (CompanyID)p->Recv_uint8();
 
	cp->cmd     = p->Recv_uint32();
 
	if (!IsValidCommand(cp->cmd))               return "invalid command";
 
	if (GetCommandFlags(cp->cmd) & CMD_OFFLINE) return "offline only command";
 
	if (GetCommandFlags(cp->cmd) & CMD_OFFLINE) return "single-player only command";
 
	if ((cp->cmd & CMD_FLAGS_MASK) != 0)        return "invalid command flag";
 

	
 
	cp->p1      = p->Recv_uint32();
src/openttd.cpp
Show inline comments
 
@@ -1131,7 +1131,7 @@ void SwitchToMode(SwitchMode new_mode)
 
			break;
 

	
 
		case SM_SAVE_GAME: // Save game.
 
			/* Make network saved games on pause compatible to singleplayer */
 
			/* Make network saved games on pause compatible to singleplayer mode */
 
			if (SaveOrLoad(_file_to_saveload.name, SLO_SAVE, DFT_GAME_FILE, NO_DIRECTORY) != SL_OK) {
 
				SetDParamStr(0, GetSaveLoadErrorString());
 
				ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
src/saveload/afterload.cpp
Show inline comments
 
@@ -571,7 +571,7 @@ bool AfterLoadGame()
 
		ResetSignalHandlers();
 
		return false;
 
	} else if (!_networking || _network_server) {
 
		/* If we are in single player, i.e. not networking, and loading the
 
		/* If we are in singleplayer mode, i.e. not networking, and loading the
 
		 * savegame or we are loading the savegame as network server we do
 
		 * not want to be bothered by being paused because of the automatic
 
		 * reason of a network server, e.g. joining clients or too few
0 comments (0 inline, 0 general)