From 64b6d03cd36746aaa6d5943ceaebdf53d3f42226 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 15 Jan 2012 18:18:44 +0000 Subject: (svn r23809) -Feature: Enhance some fatal NewGRF errors with the spritenumber that caused the problem. --- src/newgrf.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/newgrf.cpp') diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 40e074da5..9504220df 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -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; + } } } -- cgit v1.2.3-54-g00ecf