diff options
author | yexo <yexo@openttd.org> | 2009-02-19 23:10:32 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-02-19 23:10:32 +0000 |
commit | 8d4fed85e978b1eb326f33557c4ebe5dc5f93fa2 (patch) | |
tree | 45bd348b16716036400279946a2684f357ad54c0 /src | |
parent | 157bf66b0151b05091841a6f38614b478f45dcd0 (diff) | |
download | openttd-8d4fed85e978b1eb326f33557c4ebe5dc5f93fa2.tar.xz |
(svn r15525) -Fix: Don't try to find the AIs the server runs when joining a mp server.
Diffstat (limited to 'src')
-rw-r--r-- | src/saveload/ai_sl.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp index 69f05d7fd..7899c6b0b 100644 --- a/src/saveload/ai_sl.cpp +++ b/src/saveload/ai_sl.cpp @@ -10,6 +10,8 @@ #include "../string_func.h" #include "../ai/ai.hpp" #include "../ai/ai_config.hpp" +#include "../network/network.h" +#include "../ai/ai_instance.hpp" static char _ai_saveload_name[64]; static int _ai_saveload_version; @@ -53,11 +55,15 @@ static void Load_AIPL() CompanyID index; while ((index = (CompanyID)SlIterateArray()) != (CompanyID)-1) { - AIConfig *config = AIConfig::GetConfig(index); - _ai_saveload_version = -1; SlObject(NULL, _ai_company); + if (!_networking || _network_server) { + AIInstance::LoadEmpty(); + continue; + } + + AIConfig *config = AIConfig::GetConfig(index); if (StrEmpty(_ai_saveload_name)) { /* A random AI. */ config->ChangeAI(NULL); |