1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

(svn r17043) -Change [NoAI]: Load the API before compiling an AI script so AIs can subclass API classes and use API constants as part of their own constants

This commit is contained in:
yexo
2009-08-02 18:26:32 +00:00
parent 059328e85e
commit 8c2709d97f

View File

@@ -121,6 +121,9 @@ AIInstance::AIInstance(AIInfo *info) :
/* Register the AIController */
SQAIController_Register(this->engine);
/* Register the API functions and classes */
this->RegisterAPI();
/* Load and execute the script for this AI */
const char *main_script = info->GetMainScript();
if (strcmp(main_script, "%_dummy") == 0) {
@@ -137,9 +140,6 @@ AIInstance::AIInstance(AIInfo *info) :
this->Died();
return;
}
/* Register the API functions and classes */
this->RegisterAPI();
}
AIInstance::~AIInstance()