changeset 12600:bf8b42758e0f draft

(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
author yexo <yexo@openttd.org>
date Sun, 02 Aug 2009 18:26:32 +0000
parents c2422a99e313
children 3f60023ebafd
files src/ai/ai_instance.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -121,6 +121,9 @@
 	/* 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 @@
 		this->Died();
 		return;
 	}
-
-	/* Register the API functions and classes */
-	this->RegisterAPI();
 }
 
 AIInstance::~AIInstance()