(svn r3316) - NewGRF: Unload engine names before loading grf files. This fixes names in climates where the engines don't get loaded. Renamed function to reflect its purpose.

pull/155/head
peter1138 19 years ago
parent e62c3e6f39
commit 0fbb9815ba

@ -811,7 +811,7 @@ void SetCustomEngineName(EngineID engine, const char *name)
_engine_custom_names[engine] = strdup(name); _engine_custom_names[engine] = strdup(name);
} }
void UnInitNewgrEngines(void) void UnloadCustomEngineNames(void)
{ {
char **i; char **i;
for (i = _engine_custom_names; i != endof(_engine_custom_names); i++) { for (i = _engine_custom_names; i != endof(_engine_custom_names); i++) {

@ -212,7 +212,6 @@ void LoadCustomEngineNames(void);
void DeleteCustomEngineNames(void); void DeleteCustomEngineNames(void);
bool IsEngineBuildable(uint engine, byte type); bool IsEngineBuildable(uint engine, byte type);
void UnInitNewgrEngines(void);
enum { enum {
NUM_NORMAL_RAIL_ENGINES = 54, NUM_NORMAL_RAIL_ENGINES = 54,
@ -283,5 +282,6 @@ static inline const RoadVehicleInfo* RoadVehInfo(EngineID e)
void UnloadWagonOverrides(void); void UnloadWagonOverrides(void);
void UnloadCustomEngineSprites(void); void UnloadCustomEngineSprites(void);
void UnloadCustomEngineNames(void);
#endif /* ENGINE_H */ #endif /* ENGINE_H */

@ -2455,6 +2455,7 @@ static void ResetNewGRFData(void)
// Unload sprite group data // Unload sprite group data
UnloadWagonOverrides(); UnloadWagonOverrides();
UnloadCustomEngineSprites(); UnloadCustomEngineSprites();
UnloadCustomEngineNames();
// Reset price base data // Reset price base data
ResetPriceBaseMultipliers(); ResetPriceBaseMultipliers();

@ -255,7 +255,6 @@ static void UnInitializeDynamicVariables(void)
static void UnInitializeGame(void) static void UnInitializeGame(void)
{ {
UnInitWindowSystem(); UnInitWindowSystem();
UnInitNewgrEngines();
free(_config_file); free(_config_file);
} }

Loading…
Cancel
Save