mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +01:00
(svn r16060) [0.7] -Backport from trunk:
- Fix: Storing/loading some currencies failed due to inconsistent settings "tables" [FS#2826] (r16028) - Fix: 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) (r16027) - Fix: "Build separate station" in the station picker would reuse deleted stations [FS#2818] (r16025) - Fix: 32 bpp sprites in tars would also be shown in the list of heightmaps [FS#2817] (r16023) - Fix: Sometimes the unregister "query" thread could be delayed so much that the network stuff was already closed and the packet would never reach the master server causing the server to appear online longer than necessary (r16022) - Fix: Chance16() did not work for b = 1. Also transform the formula to not use divisions (r16006)
This commit is contained in:
@@ -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*/
|
||||
rndtype = RandomRange(probability_max);
|
||||
for (j = 0; j < NUM_INDUSTRYTYPES; j++) {
|
||||
|
||||
Reference in New Issue
Block a user