summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-02-21 17:01:23 +0000
committeralberth <alberth@openttd.org>2010-02-21 17:01:23 +0000
commit82a4d532b6395172537577974f18e4b61aa99bf4 (patch)
tree2c310157d0b313a84e77b82232681d7318818744 /src/industry_cmd.cpp
parentc4f67de69c84d4bc500d006af25fccdf0e4569af (diff)
downloadopenttd-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.cpp6
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);