(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

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
yexo 15 years ago
parent 93d275f1be
commit 3a7da30922

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

Loading…
Cancel
Save