mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r6948) - Codechange: Clear out all NewGRF file data before loading files again
This commit is contained in:
parent
e5e5fb6e93
commit
c098736816
18
newgrf.c
18
newgrf.c
@ -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
|
* Reset all NewGRF loaded data
|
||||||
* TODO
|
* TODO
|
||||||
@ -3118,6 +3133,9 @@ static void ResetNewGRFData(void)
|
|||||||
ResetStationClasses();
|
ResetStationClasses();
|
||||||
ResetCustomStations();
|
ResetCustomStations();
|
||||||
|
|
||||||
|
/* Reset NewGRF files */
|
||||||
|
ResetNewGRF();
|
||||||
|
|
||||||
// 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
Block a user