From 206ff68e65b1a679e96f5064e3595a183327ef6b Mon Sep 17 00:00:00 2001 From: michi_cc Date: Mon, 11 Jul 2011 16:32:19 +0000 Subject: (svn r22656) -Codechange: Deduplicate the custom error message of the industry shape and location callbacks. --- src/newgrf_industrytiles.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/newgrf_industrytiles.cpp') 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. */ -- cgit v1.2.3-54-g00ecf