summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-07-11 16:32:19 +0000
committermichi_cc <michi_cc@openttd.org>2011-07-11 16:32:19 +0000
commit206ff68e65b1a679e96f5064e3595a183327ef6b (patch)
treeb8e692a54a0d9cf28150a6e2efb1a3c78ceff8b3 /src/newgrf_industrytiles.cpp
parent1e855be4924d113d1e1eefd6345f174a86a9ef0b (diff)
downloadopenttd-206ff68e65b1a679e96f5064e3595a183327ef6b.tar.xz
(svn r22656) -Codechange: Deduplicate the custom error message of the industry shape and location callbacks.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 3315de46e..ae5dca45c 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -303,20 +303,8 @@ CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind
if (callback_res != 0) return CommandCost();
return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
}
- if (callback_res == 0x400) return CommandCost();
-
- CommandCost res;
- switch (callback_res) {
- case 0x401: res = CommandCost(STR_ERROR_SITE_UNSUITABLE); break;
- case 0x402: res = CommandCost(STR_ERROR_CAN_ONLY_BE_BUILT_IN_RAINFOREST); break;
- case 0x403: res = CommandCost(STR_ERROR_CAN_ONLY_BE_BUILT_IN_DESERT); break;
- default: res = CommandCost(GetGRFStringID(its->grf_prop.grffile->grfid, 0xD000 + callback_res)); break;
- }
-
- /* Copy some parameters from the registers to the error message text ref. stack */
- res.UseTextRefStack(4);
- return res;
+ return GetErrorMessageFromLocationCallbackResult(callback_res, its->grf_prop.grffile->grfid, STR_ERROR_SITE_UNSUITABLE);
}
/* Simple wrapper for GetHouseCallback to keep the animation unified. */