(svn r9184) [NoAI] -Revert r9183: now that was a bullshit commit noai
authortruelight
Wed, 14 Mar 2007 23:01:30 +0000
branchnoai
changeset 9392 7791ceeea57b
parent 9391 2d6da2e48112
child 9393 04bd925b9069
(svn r9184) [NoAI] -Revert r9183: now that was a bullshit commit
-Fix: remove instance-param as it is bullshit
src/ai/core/ai_factory.hpp
--- a/src/ai/core/ai_factory.hpp	Wed Mar 14 23:00:06 2007 +0000
+++ b/src/ai/core/ai_factory.hpp	Wed Mar 14 23:01:30 2007 +0000
@@ -28,11 +28,11 @@
 	/**
 	 * This registers your AI to the main system so we know about you.
 	 */
-	void RegisterFactory(AIFactoryBase *instance, const char *name)
+	void RegisterFactory(const char *name)
 	{
-		std::pair<Factories::iterator, bool> P = GetFactories().insert(Factories::value_type(name, instance));
+		std::pair<Factories::iterator, bool> P = GetFactories().insert(Factories::value_type(name, this));
 		assert(P.second);
-		instance->name = name;
+		this->name = name;
 	}
 
 public:
@@ -118,7 +118,7 @@
 template <class T>
 class AIFactory: public AIFactoryBase {
 public:
-	AIFactory() { this->RegisterFactory(this, ((T *)this)->GetName()); }
+	AIFactory() { this->RegisterFactory(((T *)this)->GetName()); }
 };
 
 #endif /* AI_FACTORY_HPP */