@@ -1609,13 +1609,17 @@ CommandCost CmdBuildIndustry(TileIndex t
if (flags & DC_EXEC) {
/* Prospecting has a chance to fail, however we cannot guarantee that something can
* be built on the map, so the chance gets lower when the map is fuller, but there
* is nothing we can really do about that. */
if (Random() <= indspec->prospecting_chance) {
for (int i = 0; i < 5000; i++) {
const Industry *ind = CreateNewIndustryHelper(RandomTile(), p1, flags, indspec, RandomRange(indspec->num_table));
/* We should not have more than one Random() in a function call
* because parameter evaluation order is not guaranteed in the c++ standard
*/
tile = RandomTile();
const Industry *ind = CreateNewIndustryHelper(tile, p1, flags, indspec, RandomRange(indspec->num_table));
if (ind != NULL) {
SetDParam(0, indspec->name);
if (indspec->new_industry_text > STR_LAST_STRINGID) {
SetDParam(1, STR_TOWN);
SetDParam(2, ind->town->index);
} else {
Status change: