From cea8546a8663db55e9d492b68ef9836550663bbe Mon Sep 17 00:00:00 2001 From: truelight Date: Tue, 22 Aug 2006 20:56:08 +0000 Subject: (svn r6056) -Codechange: don't use a loop what can be done with a simple wrapper --- town_cmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/town_cmd.c b/town_cmd.c index 59a9945b2..dcded352b 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -1063,9 +1063,7 @@ bool GenerateTowns(void) // give it a last try, but now more aggressive if (num == 0 && CreateRandomTown(10000, 0) == NULL) { - const Town* t; - - FOR_ALL_TOWNS(t) return true; + if (GetTownArraySize() > 0) return true; //XXX can we handle that more gracefully? if (num == 0 && _game_mode != GM_EDITOR) { -- cgit v1.2.3-70-g09d2