summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-09-01 18:52:27 +0000
committerterkhen <terkhen@openttd.org>2010-09-01 18:52:27 +0000
commitc6db7637818765193e9de8f3d11b8a2362e50f96 (patch)
treea647f94266944c4e3414af7fea221dcf89883a67 /src/town_cmd.cpp
parent7a5b9951577e22351d9b6dfe968bdb9e6f8900c1 (diff)
downloadopenttd-c6db7637818765193e9de8f3d11b8a2362e50f96.tar.xz
(svn r20710) -Codechange: Clarify the name of some town generation variables.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 53d2a5474..f99b1a081 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1773,12 +1773,12 @@ static const byte _num_initial_towns[4] = {5, 11, 23, 46}; // very low, low, no
*/
bool GenerateTowns(TownLayout layout)
{
- uint num = 0;
+ uint current_number = 0;
uint difficulty = _settings_game.difficulty.number_towns;
- uint n = (difficulty == (uint)CUSTOM_TOWN_NUMBER_DIFFICULTY) ? _settings_game.game_creation.custom_town_number : ScaleByMapSize(_num_initial_towns[difficulty] + (Random() & 7));
+ uint total = (difficulty == (uint)CUSTOM_TOWN_NUMBER_DIFFICULTY) ? _settings_game.game_creation.custom_town_number : ScaleByMapSize(_num_initial_towns[difficulty] + (Random() & 7));
uint32 townnameparts;
- SetGeneratingWorldProgress(GWP_TOWN, n);
+ SetGeneratingWorldProgress(GWP_TOWN, total);
/* First attempt will be made at creating the suggested number of towns.
* Note that this is really a suggested value, not a required one.
@@ -1789,12 +1789,12 @@ bool GenerateTowns(TownLayout layout)
/* Get a unique name for the town. */
if (!GenerateTownName(&townnameparts)) continue;
/* try 20 times to create a random-sized town for the first loop. */
- if (CreateRandomTown(20, townnameparts, TSZ_RANDOM, city, layout) != NULL) num++; // If creation was successful, raise a flag.
- } while (--n);
+ if (CreateRandomTown(20, townnameparts, TSZ_RANDOM, city, layout) != NULL) current_number++; // If creation was successful, raise a flag.
+ } while (--total);
- if (num != 0) return true;
+ if (current_number != 0) return true;
- /* If num is still zero at this point, it means that not a single town has been created.
+ /* If current_number is still zero at this point, it means that not a single town has been created.
* So give it a last try, but now more aggressive */
if (GenerateTownName(&townnameparts) &&
CreateRandomTown(10000, townnameparts, TSZ_RANDOM, _settings_game.economy.larger_towns != 0, layout) != NULL) {