(svn r12308) [NoAI] -Fix: don't allow AddList on lists of different types noai
authortruebrain
Thu, 28 Feb 2008 01:04:50 +0000
branchnoai
changeset 9802 1095a6d029ed
parent 9801 03a3eebd7fb7
child 9803 c86d5834fb11
(svn r12308) [NoAI] -Fix: don't allow AddList on lists of different types
src/ai/api/ai_abstractlist.cpp
--- a/src/ai/api/ai_abstractlist.cpp	Thu Feb 28 00:59:01 2008 +0000
+++ b/src/ai/api/ai_abstractlist.cpp	Thu Feb 28 01:04:50 2008 +0000
@@ -327,6 +327,11 @@
 
 void AIAbstractList::AddList(AIAbstractList *list)
 {
+	if (this->GetListName() != NULL && list->GetListName() != NULL && strcmp(this->GetListName(), list->GetListName()) != 0) {
+		DEBUG(ai, 0, "WARNING: You are trying to add a list %s to a list which\n", list->GetListName());
+		DEBUG(ai, 0, " is based on %s. In general, this can't work. Expect fuzzy results!\n", this->GetListName());
+	}
+
 	AIAbstractListMap *list_items = &list->items;
 	for (AIAbstractListMap::iterator iter = list_items->begin(); iter != list_items->end(); iter++) {
 		this->AddItem((*iter).first);