diff options
author | yexo <yexo@openttd.org> | 2009-09-22 11:10:04 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-09-22 11:10:04 +0000 |
commit | 3a7da3092216390f5c466fe4198d263f6c638f2b (patch) | |
tree | 8bc25f46a14342a856561f0d701c22aae3e38ed8 | |
parent | 93d275f1be2963ff02f934d840966b1d3c01c516 (diff) | |
download | openttd-3a7da3092216390f5c466fe4198d263f6c638f2b.tar.xz |
(svn r17609) -Fix: the dummy AI had no API version set, causing the 'API compatibility script not found' error to be printed when loading it
-rw-r--r-- | src/ai/ai_info.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 244ad5ebd..d6337d511 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -20,6 +20,7 @@ #include "../settings_type.h" #include "../openttd.h" #include "../debug.h" +#include "../rev.h" AIConfigItem _start_date_config = { "start_date", @@ -114,6 +115,10 @@ static bool CheckAPIVersion(const char *api_version) SQInteger res = AIFileInfo::Constructor(vm, info); if (res != 0) return res; + char buf[8]; + seprintf(buf, lastof(buf), "%d.%d", GB(_openttd_newgrf_version, 28, 4), GB(_openttd_newgrf_version, 24, 4)); + info->api_version = strdup(buf); + /* Remove the link to the real instance, else it might get deleted by RegisterAI() */ sq_setinstanceup(vm, 2, NULL); /* Register the AI to the base system */ |