(svn r19185) -Codechange: Return succeeded or failed CommandCost from CheckIfCallBackAllowsCreation().

This commit is contained in:
alberth
2010-02-21 17:01:23 +00:00
parent b882106956
commit 19f5b6f7b6
3 changed files with 21 additions and 14 deletions

View File

@@ -1708,12 +1708,12 @@ static Industry *CreateNewIndustryHelper(TileIndex tile, IndustryType type, DoCo
if (ret.Failed()) return NULL;
if (HasBit(GetIndustrySpec(type)->callback_mask, CBM_IND_LOCATION)) {
if (!CheckIfCallBackAllowsCreation(tile, type, itspec_index, seed)) return NULL;
ret = CheckIfCallBackAllowsCreation(tile, type, itspec_index, seed);
} else {
ret = _check_new_industry_procs[indspec->check_proc](tile);
ret.SetGlobalErrorMessage();
if (ret.Failed()) return NULL;
}
ret.SetGlobalErrorMessage();
if (ret.Failed()) return NULL;
if (!custom_shape_check && _settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world && !_ignore_restrictions && !CheckIfCanLevelIndustryPlatform(tile, DC_NO_WATER, it, type)) return NULL;
ret = CheckIfFarEnoughFromIndustry(tile, type);