summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-11-13 15:02:31 +0000
committeralberth <alberth@openttd.org>2010-11-13 15:02:31 +0000
commit1bf94674dfb507849bc5f6c7dffc112cdf89b308 (patch)
tree396647189733cdef3b68c5cd18ae6e7007b509f9 /src/industry_cmd.cpp
parentd46a2ef122a4dc3a44bfba97a1e7c5f112344c0c (diff)
downloadopenttd-1bf94674dfb507849bc5f6c7dffc112cdf89b308.tar.xz
(svn r21166) -Codechange: Move MaybeNewIndustry() to IndustryBuildData::TryBuildNewIndustry().
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index e7df05c18..6b19bc447 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -59,6 +59,7 @@ uint16 Industry::counts[NUM_INDUSTRYTYPES];
IndustrySpec _industry_specs[NUM_INDUSTRYTYPES];
IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES];
+IndustryBuildData _industry_builder; ///< In-game manager of industries.
/**
* This function initialize the spec arrays of both
@@ -2051,7 +2052,7 @@ struct ProbabilityHelper {
/**
* Try to create a random industry, during gameplay
*/
-static void MaybeNewIndustry()
+void IndustryBuildData::TryBuildNewIndustry()
{
uint num = 0;
ProbabilityHelper cumulative_probs[NUM_INDUSTRYTYPES]; // probability collector
@@ -2454,7 +2455,7 @@ void IndustryDailyLoop()
for (uint16 j = 0; j < change_loop; j++) {
/* 3% chance that we start a new industry */
if (Chance16(3, 100)) {
- MaybeNewIndustry();
+ _industry_builder.TryBuildNewIndustry();
} else {
Industry *i = Industry::GetRandom();
if (i != NULL) {