summaryrefslogtreecommitdiff
path: root/town_cmd.c
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
commit3cdabcbbac5ae64c132f0162090079d8c5cf3f90 (patch)
tree201fbda2a58cd5307db6fe58f6fac6591b99f02c /town_cmd.c
parent5fd9aeb12b75a3971e86e5b7d1701115f57fbc12 (diff)
downloadopenttd-3cdabcbbac5ae64c132f0162090079d8c5cf3f90.tar.xz
(svn r6056) -Codechange: don't use a loop what can be done with a simple wrapper
Diffstat (limited to 'town_cmd.c')
-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) {