diff -r 0980b66406af -r 82a50c80b0c4 openttd.c --- a/openttd.c Thu Dec 21 10:09:43 2006 +0000 +++ b/openttd.c Thu Dec 21 10:29:16 2006 +0000 @@ -1559,3 +1559,24 @@ return true; } + +/** Reload all NewGRF files during a running game. This is a cut-down + * version of AfterLoadGame(). + * XXX - We need to reset the vehicle position hash because with a non-empty + * hash AfterLoadVehicles() will loop infinitely. We need AfterLoadVehicles() + * to recalculate vehicle data as some NewGRF vehicle sets could have been + * removed or added and changed statistics */ +void ReloadNewGRFData(void) +{ + /* reload grf data */ + GfxLoadSprites(); + LoadStringWidthTable(); + /* reload vehicles */ + ResetVehiclePosHash(); + AfterLoadVehicles(); + /* update station and waypoint graphics */ + AfterLoadWaypoints(); + AfterLoadStations(); + /* redraw the whole screen */ + MarkWholeScreenDirty(); +}