(svn r12268) [NoAI] -Fix: allow AIList_vRandomize to run over any list noai
authortruebrain
Tue, 26 Feb 2008 15:14:45 +0000
branchnoai
changeset 9775 4a30f9e841ca
parent 9774 74115e38e688
child 9776 ee9923d46fba
(svn r12268) [NoAI] -Fix: allow AIList_vRandomize to run over any list
src/ai/api/ai_abstractlist.cpp
src/ai/api/ai_list_valuator.hpp
--- a/src/ai/api/ai_abstractlist.cpp	Tue Feb 26 15:14:21 2008 +0000
+++ b/src/ai/api/ai_abstractlist.cpp	Tue Feb 26 15:14:45 2008 +0000
@@ -530,7 +530,7 @@
 
 void AIAbstractList::Valuate(const AIAbstractList::Valuator &proc)
 {
-	if (this->GetListName() != NULL && strcmp(this->GetListName(), proc.GetListName()) != 0) {
+	if (this->GetListName() != NULL && proc.GetListName() != NULL && strcmp(this->GetListName(), proc.GetListName()) != 0) {
 		DEBUG(ai, 0, "WARNING: You are trying to use a valuator for %s on a list which\n", this->GetListName());
 		DEBUG(ai, 0, " is based on %s. In general, this can't work. Expect fuzzy results!\n", proc.GetListName());
 	}
--- a/src/ai/api/ai_list_valuator.hpp	Tue Feb 26 15:14:21 2008 +0000
+++ b/src/ai/api/ai_list_valuator.hpp	Tue Feb 26 15:14:45 2008 +0000
@@ -23,7 +23,7 @@
 	/**
 	 * The name of this list, to check if we can be used with a List.
 	 */
-	const char *GetListName() const { return "AIList"; }
+	const char *GetListName() const { return NULL; }
 
 	int32 Valuate(int32 item) const;
 };