summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-08-02 18:26:32 +0000
committeryexo <yexo@openttd.org>2009-08-02 18:26:32 +0000
commit8c2709d97f5ac3f81936a4e1163721b6ad20f5c7 (patch)
tree9260144051eef52d5113bf639d62006c8e8e4e93
parent059328e85ea459ff14e9d9069dd1663f33233d7b (diff)
downloadopenttd-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
-rw-r--r--src/ai/ai_instance.cpp6
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()