mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-14 16:15:14 +01: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:
parent
059328e85e
commit
8c2709d97f
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user