# HG changeset patch # User tron # Date 1107209835 0 # Node ID 6e5662905cb10a150fbbbfc1c24b23356a9cd33b # Parent fa73bce0f2e0303970c2fd51c982d37c6ddbac4f (svn r1757) Stop the new AI from trying to build its HQ on non-existent tiles diff -r fa73bce0f2e0 -r 6e5662905cb1 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;