(svn r26240) -Codechange: Pass the GRFFile to GetErrorMessageFromLocationCallbackResult instead of the GRFID.

This commit is contained in:
frosch
2014-01-12 18:00:19 +00:00
parent 477c15383d
commit 73c6565cf2
6 changed files with 10 additions and 8 deletions

View File

@@ -473,16 +473,16 @@ uint32 GetCompanyInfo(CompanyID owner, const Livery *l)
/**
* Get the error message from a shape/location/slope check callback result.
* @param cb_res Callback result to translate. If bit 10 is set this is a standard error message, otherwise a NewGRF provided string.
* @param grfid grfID to use to resolve a custom error message.
* @param grffile NewGRF to use to resolve a custom error message.
* @param default_error Error message to use for the generic error.
* @return CommandCost indicating success or the error message.
*/
CommandCost GetErrorMessageFromLocationCallbackResult(uint16 cb_res, uint32 grfid, StringID default_error)
CommandCost GetErrorMessageFromLocationCallbackResult(uint16 cb_res, const GRFFile *grffile, StringID default_error)
{
CommandCost res;
if (cb_res < 0x400) {
res = CommandCost(GetGRFStringID(grfid, 0xD000 + cb_res));
res = CommandCost(GetGRFStringID(grffile->grfid, 0xD000 + cb_res));
} else {
switch (cb_res) {
case 0x400: return res; // No error.