Change: Apply some consistency to singleplayer related comments

This commit is contained in:
glx22 2021-01-22 16:24:29 +01:00 committed by Loïc Guilloux
parent 07385c3662
commit 6b8ad5a9b1
8 changed files with 12 additions and 12 deletions

View File

@ -882,7 +882,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
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);

View File

@ -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;

View File

@ -289,7 +289,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_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 *c)
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, DoCommandFlag flags, uint32 p1, uint32
/* 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 */

View File

@ -113,7 +113,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
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);

View File

@ -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;

View File

@ -298,7 +298,7 @@ const char *NetworkGameSocketHandler::ReceiveCommand(Packet *p, CommandPacket *c
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();

View File

@ -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);

View File

@ -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