(svn r23809) -Feature: Enhance some fatal NewGRF errors with the spritenumber that caused the problem.

This commit is contained in:
frosch
2012-01-15 18:18:44 +00:00
parent dfb5c78dc6
commit 64b6d03cd3
2 changed files with 12 additions and 9 deletions

View File

@@ -418,6 +418,7 @@ static GRFError *DisableGrf(StringID message = STR_NULL, GRFConfig *config = NUL
if (message != STR_NULL) {
delete config->error;
config->error = new GRFError(STR_NEWGRF_ERROR_MSG_FATAL, message);
if (config == _cur.grfconfig) config->error->param_value[0] = _cur.nfo_line;
}
return config->error;
@@ -4160,10 +4161,12 @@ static bool HandleChangeInfoResult(const char *caller, ChangeInfoResult cir, uin
grfmsg(0, "%s: Unknown property 0x%02X of feature 0x%02X, disabling", caller, property, feature);
/* FALL THROUGH */
case CIR_INVALID_ID:
case CIR_INVALID_ID: {
/* No debug message for an invalid ID, as it has already been output */
DisableGrf(cir == CIR_INVALID_ID ? STR_NEWGRF_ERROR_INVALID_ID : STR_NEWGRF_ERROR_UNKNOWN_PROPERTY);
GRFError *error = DisableGrf(cir == CIR_INVALID_ID ? STR_NEWGRF_ERROR_INVALID_ID : STR_NEWGRF_ERROR_UNKNOWN_PROPERTY);
if (cir != CIR_INVALID_ID) error->param_value[1] = property;
return true;
}
}
}