summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-22 20:56:08 +0000
committertruelight <truelight@openttd.org>2006-08-22 20:56:08 +0000
commitcea8546a8663db55e9d492b68ef9836550663bbe (patch)
tree201fbda2a58cd5307db6fe58f6fac6591b99f02c
parent15aff22c965913598652666046c522eaa0c76641 (diff)
downloadopenttd-cea8546a8663db55e9d492b68ef9836550663bbe.tar.xz
(svn r6056) -Codechange: don't use a loop what can be done with a simple wrapper
-rw-r--r--town_cmd.c4
1 files changed, 1 insertions, 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) {