summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 8be44488d..69727bfd7 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -20,6 +20,7 @@
#include "company_base.h"
#include "genworld.h"
#include "tree_map.h"
+#include "tunnel_map.h"
#include "newgrf_cargo.h"
#include "newgrf_debug.h"
#include "newgrf_industrytiles.h"
@@ -1523,6 +1524,11 @@ static CommandCost CheckIfIndustryIsAllowed(TileIndex tile, int type, const Town
return_cmd_error(STR_ERROR_CAN_ONLY_BE_BUILT_NEAR_TOWN_CENTER);
}
+ if (type == IT_OIL_RIG &&
+ (IsTunnelInWay(tile, 0) ||
+ IsTunnelInWay(tile + TileDiffXY(0, 1), 0) ||
+ IsTunnelInWay(tile + TileDiffXY(1, 2), 0))) return_cmd_error(STR_ERROR_NO_DRILLING_ABOVE_CHUNNEL);
+
return CommandCost();
}