mirror of https://github.com/OpenTTD/OpenTTD
(svn r10110) -Fix: Reset NewGRF errors along with all the other NewGRF data so that errors get loaded again when pressing "Apply".
parent
be0539cb43
commit
105c7455ae
|
@ -4398,6 +4398,16 @@ static void ResetNewGRF()
|
||||||
_cur_grffile = NULL;
|
_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
|
* Reset all NewGRF loaded data
|
||||||
* TODO
|
* TODO
|
||||||
|
@ -4465,6 +4475,9 @@ static void ResetNewGRFData()
|
||||||
/* Reset NewGRF files */
|
/* Reset NewGRF files */
|
||||||
ResetNewGRF();
|
ResetNewGRF();
|
||||||
|
|
||||||
|
/* Reset NewGRF errors. */
|
||||||
|
ResetNewGRFErrors();
|
||||||
|
|
||||||
/* Add engine type to engine data. This is needed for the refit precalculation. */
|
/* Add engine type to engine data. This is needed for the refit precalculation. */
|
||||||
AddTypeToEngines();
|
AddTypeToEngines();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue