summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-23 21:47:03 +0000
committerfrosch <frosch@openttd.org>2010-04-23 21:47:03 +0000
commitca9a015984fa7c0c49ddb587635cd65b594c723a (patch)
tree66ef604573811953ed924662d2d2ce13653b8c4c /src/industry_cmd.cpp
parent7a56196d98656a2080f5918699d37773ba294d69 (diff)
downloadopenttd-ca9a015984fa7c0c49ddb587635cd65b594c723a.tar.xz
(svn r19701) -Fix [FS#3787]: Check for industry availability more thoroughly and cancel object placement when selecting not available industries.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 24d279170..35a5fe49c 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1764,6 +1764,10 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
return CMD_ERROR;
}
+ if (_game_mode != GM_EDITOR && !CheckIfCallBackAllowsAvailability(it, IACT_USERCREATION)) {
+ return CMD_ERROR;
+ }
+
Industry *ind = NULL;
if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && indspec->IsRawIndustry()) {
if (flags & DC_EXEC) {