diff options
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r-- | src/newgrf_industries.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index fa4fdf197..71118b126 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -544,20 +544,9 @@ CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uin * the building of the industry, as that's how it's done in TTDP. */ if (group == NULL) return CommandCost(); uint16 result = group->GetCallbackResult(); - if (result == 0x400 || result == CALLBACK_FAILED) return CommandCost(); - - CommandCost res; - switch (result) { - 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(indspec->grf_prop.grffile->grfid, 0xD000 + result)); break; - } - - /* Copy some parameters from the registers to the error message text ref. stack */ - res.UseTextRefStack(4); + if (result == CALLBACK_FAILED) return CommandCost(); - return res; + return GetErrorMessageFromLocationCallbackResult(result, indspec->grf_prop.grffile->grfid, STR_ERROR_SITE_UNSUITABLE); } /** |