mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-22 11:55:19 +01:00
(svn r16027) -Fix (r9555): Usage of uninitialised memory when trying to build a random new industry, but there are no industrytypes to choose from (i.e. all appearance probabilities are zero).
This commit is contained in:
parent
be7215497c
commit
1b85c10a5b
@ -1872,6 +1872,9 @@ static void MaybeNewIndustry(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Abort if there is no industry buildable */
|
||||||
|
if (probability_max == 0) return;
|
||||||
|
|
||||||
/* Find a random type, with maximum being what has been evaluate above*/
|
/* Find a random type, with maximum being what has been evaluate above*/
|
||||||
rndtype = RandomRange(probability_max);
|
rndtype = RandomRange(probability_max);
|
||||||
for (j = 0; j < NUM_INDUSTRYTYPES; j++) {
|
for (j = 0; j < NUM_INDUSTRYTYPES; j++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user