summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authororudge <orudge@openttd.org>2004-08-15 22:17:46 +0000
committerorudge <orudge@openttd.org>2004-08-15 22:17:46 +0000
commitc4b9a9cc709536dbeee67a676be32bf0e3010058 (patch)
treec66a423e55dbae3e5a2ce8f31456a1404463e3e8 /industry_cmd.c
parent86f4959b55259bb1fc5ef4abef886f98d03dc132 (diff)
downloadopenttd-c4b9a9cc709536dbeee67a676be32bf0e3010058.tar.xz
(svn r62) - Added "None" as option for number of industries in difficulty settings
- Updated French translation (by testman57)
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 48560cfba..de36565a6 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1564,7 +1564,8 @@ Industry *CreateNewIndustry(uint tile, int type)
return i;
}
-static const byte _numof_industry_table[3][12] = {
+static const byte _numof_industry_table[4][12] = {
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5},
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
{0, 2, 3, 4, 6, 7, 8, 9, 10, 10, 10},
@@ -1573,16 +1574,19 @@ static const byte _numof_industry_table[3][12] = {
static void PlaceInitialIndustry(byte type, int amount)
{
int num = _numof_industry_table[_opt.diff.number_industries][amount];
+
+ if (_opt.diff.number_industries != 0)
+ {
+ assert(num > 0);
- assert(num > 0);
-
- do {
- int i = 2000;
do {
- if (CreateNewIndustry(TILE_MASK(Random()), type) != NULL)
- break;
- } while (--i != 0);
- } while (--num);
+ int i = 2000;
+ do {
+ if (CreateNewIndustry(TILE_MASK(Random()), type) != NULL)
+ break;
+ } while (--i != 0);
+ } while (--num);
+ }
}
void GenerateIndustries()