src/ai/core/ai_factory.hpp
branchnoai
changeset 9402 45581b218c98
parent 9401 04502c3557f2
--- a/src/ai/core/ai_factory.hpp	Thu Mar 15 10:29:43 2007 +0000
+++ b/src/ai/core/ai_factory.hpp	Thu Mar 15 11:53:41 2007 +0000
@@ -75,16 +75,16 @@
 		Factories::iterator first_it;
 		for (; i > 0; i--) it++;
 		first_it = it;
-		AIFactoryBase *f = (*it).second;
+		AIFactoryBase *f = it->second;
 
 		if (!f->AllowStartup()) {
 			/* We can't start this AI, try to find the next best */
 			do {
+				it++;
 				if (it == GetFactories().end()) it = GetFactories().begin();
-				else it++;
 				/* Back at the beginning? Drop out! */
 				if (first_it == it) break;
-				f = (*it).second;
+				f = it->second;
 			} while (!f->AllowStartup());
 			/* Unable to start any AI */
 			if (first_it == it) return NULL;