summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-01-15 18:18:44 +0000
committerfrosch <frosch@openttd.org>2012-01-15 18:18:44 +0000
commit64b6d03cd36746aaa6d5943ceaebdf53d3f42226 (patch)
tree44392305df939cc9662e462118f9235d7de652d8 /src/newgrf.cpp
parentdfb5c78dc65e03b40a0a20f6f76ffb79cb40b6cc (diff)
downloadopenttd-64b6d03cd36746aaa6d5943ceaebdf53d3f42226.tar.xz
(svn r23809) -Feature: Enhance some fatal NewGRF errors with the spritenumber that caused the problem.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp7
1 files changed, 5 insertions, 2 deletions
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;
+ }
}
}