diff options
author | peter1138 <peter1138@openttd.org> | 2006-10-26 19:16:10 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-10-26 19:16:10 +0000 |
commit | c09873681687172583bda5e92c4f5c53d141a0d2 (patch) | |
tree | 18801fe44b82a62dc4b8377421584dd261796485 | |
parent | e5e5fb6e938b81963b7b88a84b02bdac067dfbf5 (diff) | |
download | openttd-c09873681687172583bda5e92c4f5c53d141a0d2.tar.xz |
(svn r6948) - Codechange: Clear out all NewGRF file data before loading files again
-rw-r--r-- | newgrf.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -3068,6 +3068,21 @@ static void ResetCustomStations(void) } } +static void ResetNewGRF(void) +{ + GRFFile *f, *next; + + for (f = _first_grffile; f != NULL; f = next) { + next = f->next; + + free(f->filename); + free(f); + } + + _first_grffile = NULL; + _cur_grffile = NULL; +} + /** * Reset all NewGRF loaded data * TODO @@ -3118,6 +3133,9 @@ static void ResetNewGRFData(void) ResetStationClasses(); ResetCustomStations(); + /* Reset NewGRF files */ + ResetNewGRF(); + // Add engine type to engine data. This is needed for the refit precalculation. AddTypeToEngines(); |