summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-06-12 09:41:12 +0000
committermaedhros <maedhros@openttd.org>2007-06-12 09:41:12 +0000
commite5ea54fe222032dd61cd3c00c9cb98ed23a9b02e (patch)
tree293c6e410d9fdb29bb6b991aaf661a1cd0ea4eff /src
parent961a8915635075295676783006f4b4f17b90aebd (diff)
downloadopenttd-e5ea54fe222032dd61cd3c00c9cb98ed23a9b02e.tar.xz
(svn r10110) -Fix: Reset NewGRF errors along with all the other NewGRF data so that errors get loaded again when pressing "Apply".
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 6241d679d..549981db5 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -4398,6 +4398,16 @@ static void ResetNewGRF()
_cur_grffile = NULL;
}
+static void ResetNewGRFErrors()
+{
+ for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+ if (!HASBIT(c->flags, GCF_COPY) && c->error != NULL) {
+ free(c->error);
+ c->error = NULL;
+ }
+ }
+}
+
/**
* Reset all NewGRF loaded data
* TODO
@@ -4465,6 +4475,9 @@ static void ResetNewGRFData()
/* Reset NewGRF files */
ResetNewGRF();
+ /* Reset NewGRF errors. */
+ ResetNewGRFErrors();
+
/* Add engine type to engine data. This is needed for the refit precalculation. */
AddTypeToEngines();