(svn r22656) -Codechange: Deduplicate the custom error message of the industry shape and location callbacks.
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user