From 3a7da3092216390f5c466fe4198d263f6c638f2b Mon Sep 17 00:00:00 2001 From: yexo Date: Tue, 22 Sep 2009 11:10:04 +0000 Subject: [PATCH] (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 --- src/ai/ai_info.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 244ad5ebdb..d6337d511d 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 */