diff options
author | glx22 <glx@openttd.org> | 2021-01-18 15:33:39 +0100 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-01-22 22:19:55 +0100 |
commit | 07385c36623ede05fbc4ac49076e1a26e349d731 (patch) | |
tree | 995e5b3f759315cf56a6cd90e8ac92efc56dbfef /src/console_cmds.cpp | |
parent | 485aafc1b7d51967e06cc5db76c195edcf8dc644 (diff) | |
download | openttd-07385c36623ede05fbc4ac49076e1a26e349d731.tar.xz |
Fix: Use the same safety checks as 'stop_ai' for 'reload_ai'
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r-- | src/console_cmds.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 140d91e70..f701df034 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1248,7 +1248,8 @@ DEF_CONSOLE_CMD(ConReloadAI) return true; } - if (Company::IsHumanID(company_id)) { + /* In offline 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; } @@ -1285,6 +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. */ if (Company::IsHumanID(company_id) || company_id == _local_company) { IConsoleWarning("Company is not controlled by an AI."); return true; |