summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-11-14 16:16:28 +0000
committerfrosch <frosch@openttd.org>2010-11-14 16:16:28 +0000
commit478da38d2b1c6174417e683616d3e3ea4559f467 (patch)
treea9495f19af9e521595e4b552ccf38ee7215775a5
parent1fe2ce42cac0cddcd33c060ed6ce3b9484fca36c (diff)
downloadopenttd-478da38d2b1c6174417e683616d3e3ea4559f467.tar.xz
(svn r21192) -Fix (r15505)[FS#4226]: Use non-interactive randomness for townnames on map generation, so they are controlled by the generation-seed as well.
-rw-r--r--src/townname.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/townname.cpp b/src/townname.cpp
index f734f549b..5377a7ae5 100644
--- a/src/townname.cpp
+++ b/src/townname.cpp
@@ -16,6 +16,7 @@
#include "core/alloc_func.hpp"
#include "strings_func.h"
#include "core/random_func.hpp"
+#include "genworld.h"
#include "table/townname.h"
@@ -118,7 +119,7 @@ bool GenerateTownName(uint32 *townnameparts)
TownNameParams par(_settings_game.game_creation.town_name);
for (int i = 1000; i != 0; i--) {
- uint32 r = InteractiveRandom();
+ uint32 r = _generating_world ? Random() : InteractiveRandom();
if (!VerifyTownName(r, &par)) continue;
*townnameparts = r;