diff options
author | yexo <yexo@openttd.org> | 2009-08-02 18:26:32 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-08-02 18:26:32 +0000 |
commit | 8c2709d97f5ac3f81936a4e1163721b6ad20f5c7 (patch) | |
tree | 9260144051eef52d5113bf639d62006c8e8e4e93 /src | |
parent | 059328e85ea459ff14e9d9069dd1663f33233d7b (diff) | |
download | openttd-8c2709d97f5ac3f81936a4e1163721b6ad20f5c7.tar.xz |
(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
Diffstat (limited to 'src')
-rw-r--r-- | src/ai/ai_instance.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 45e336d5c..28d416925 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -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() |