src/ai/api/ai_controller.hpp
branchnoai
changeset 9439 b0482f81af3c
parent 9436 e28503f827a5
child 9441 03da911c8d5f
--- a/src/ai/api/ai_controller.hpp	Fri Mar 16 09:59:19 2007 +0000
+++ b/src/ai/api/ai_controller.hpp	Fri Mar 16 10:00:17 2007 +0000
@@ -34,6 +34,20 @@
 	uint GetTick() { return this->tick; }
 };
 
+#endif /* AI_CONTROLLER_HPP */
+
+/*
+ * The next part of the code is outside of the multiple inclusions
+ * protection. This is done because the Squirrel code needs the
+ * AIController class declaration to make the Squirrel registration
+ * functions. So in the first include DEFINE_SQUIRREL_CLASS is not
+ * defined, but in the second one it will when included from the
+ * Squirrel AI implementation.
+ * All other instances that include this header twice must not have
+ * set DEFINE_SQUIRREL_CLASS, so this part will not be included
+ * twice under those circumstances.
+ */
+
 #ifdef DEFINE_SQUIRREL_CLASS
 void SQAIControllerRegister(Squirrel *engine) {
 	DefSQClass <AIControllerSquirrel> SQAIController("AIController");
@@ -42,5 +56,3 @@
 	SQAIController.PostRegister(engine);
 }
 #endif /* SQUIRREL_CLASS */
-
-#endif /* AI_CONTROLLER_HPP */