(svn r1757) Stop the new AI from trying to build its HQ on non-existent tiles
authortron
Mon, 31 Jan 2005 22:17:15 +0000
changeset 1253 6e5662905cb1
parent 1252 fa73bce0f2e0
child 1254 b25f77484174
(svn r1757) Stop the new AI from trying to build its HQ on non-existent tiles
ai_new.c
--- a/ai_new.c	Mon Jan 31 21:57:05 2005 +0000
+++ b/ai_new.c	Mon Jan 31 22:17:15 2005 +0000
@@ -90,7 +90,7 @@
 		// We have no HQ yet, build one on a random place
 		// Random till we found a place for it!
 		// TODO: this should not be on a random place..
-		while (!AiNew_Build_CompanyHQ(p, (Random()&0xFFFF))) { }
+		while (!AiNew_Build_CompanyHQ(p, Random() % MapSize())) { }
 		// Enough for now, but we want to come back here the next time
 		//  so we do not change any status
 		return;