(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

This commit is contained in:
yexo 2009-09-22 11:10:04 +00:00
parent 93d275f1be
commit 3a7da30922
1 changed files with 5 additions and 0 deletions

View File

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