diff options
author | alberth <alberth@openttd.org> | 2010-02-21 17:01:23 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-02-21 17:01:23 +0000 |
commit | 82a4d532b6395172537577974f18e4b61aa99bf4 (patch) | |
tree | 2c310157d0b313a84e77b82232681d7318818744 /src/industry_cmd.cpp | |
parent | c4f67de69c84d4bc500d006af25fccdf0e4569af (diff) | |
download | openttd-82a4d532b6395172537577974f18e4b61aa99bf4.tar.xz |
(svn r19185) -Codechange: Return succeeded or failed CommandCost from CheckIfCallBackAllowsCreation().
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 846f3c9cc..e16d5b261 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -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); |