--- a/src/ai/core/ai_base.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_base.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -39,7 +39,7 @@
bool Chance(uint out, uint max);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAIBaseRegister(Squirrel *engine) {
DefSQClass <AIBase> SQAIBase("AIBase");
SQAIBase.PreRegister(engine);
--- a/src/ai/core/ai_cargo.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_cargo.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -35,7 +35,7 @@
int32 GetCargoIncome(uint32 distance, uint32 days_in_transit, CargoID cargo_type);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAICargoRegister(Squirrel *engine) {
DefSQClass <AICargo> SQAICargo("AICargo");
SQAICargo.PreRegister(engine);
--- a/src/ai/core/ai_company.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_company.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -71,7 +71,7 @@
bool SetLoanAmount(int32 loan);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAICompanyRegister(Squirrel *engine) {
DefSQClass <AICompany> SQAICompany("AICompany");
SQAICompany.PreRegister(engine);
--- a/src/ai/core/ai_controller.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_controller.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -36,7 +36,7 @@
#endif /* AI_CONTROLLER_HPP */
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAIControllerRegister(Squirrel *engine) {
DefSQClass <AIControllerSquirrel> SQAIController("AIController");
SQAIController.PreRegister(engine);
--- a/src/ai/core/ai_industry.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_industry.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -49,7 +49,7 @@
TileIndex GetLocation(IndustryID industry_id);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAIIndustryRegister(Squirrel *engine) {
DefSQClass <AIIndustry> SQAIIndustry("AIIndustry");
SQAIIndustry.PreRegister(engine);
--- a/src/ai/core/ai_map.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_map.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -56,7 +56,7 @@
uint32 GetTileY(TileIndex t);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAIMapRegister(Squirrel *engine) {
DefSQClass <AIMap> SQAIMap("AIMap");
SQAIMap.PreRegister(engine);
--- a/src/ai/core/ai_town.hpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/core/ai_town.hpp Thu Mar 15 22:17:28 2007 +0000
@@ -58,7 +58,7 @@
TileIndex GetLocation(TownID town_id);
};
-#ifdef SQUIRREL_CLASS
+#ifdef DEFINE_SQUIRREL_CLASS
void SQAITownRegister(Squirrel *engine) {
DefSQClass <AITown> SQAITown("AITown");
SQAITown.PreRegister(engine);
--- a/src/ai/squirrel/squirrel.cpp Thu Mar 15 22:08:00 2007 +0000
+++ b/src/ai/squirrel/squirrel.cpp Thu Mar 15 22:17:28 2007 +0000
@@ -3,14 +3,16 @@
/** @file squirrel.cpp allows loading squirrel scripts to control an AI */
#include "../../stdafx.h"
-#include "squirrel.hpp"
#include "../../debug.h"
+#include "../../openttd.h"
#include "../../string.h"
#include "../../fios.h"
+#include "squirrel.hpp"
#include <sys/types.h>
#include <sys/stat.h>
-#define SQUIRREL_CLASS
+/* Convert all AI related classes to Squirrel data */
+#define DEFINE_SQUIRREL_CLASS
#include "../../squirrel_helper.hpp"
#include "../../squirrel_class.hpp"
#include "../core/ai_base.hpp"