From 8c2709d97f5ac3f81936a4e1163721b6ad20f5c7 Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 2 Aug 2009 18:26:32 +0000 Subject: (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 --- src/ai/ai_instance.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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() -- cgit v1.2.3-54-g00ecf