mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
Add: Apply rail/road type conversion when NewGRFs are updated mid-game.
This will update the rail/road type of tiles on the map, taking account of tram state, if types are moved around.
This commit is contained in:
parent
8bb6572943
commit
3b6d3080f2
@ -3362,6 +3362,7 @@ void ReloadNewGRFData()
|
||||
RecomputePrices();
|
||||
/* reload vehicles */
|
||||
ResetVehicleHash();
|
||||
AfterLoadLabelMaps();
|
||||
AfterLoadVehiclesPhase1(false);
|
||||
AfterLoadVehiclesPhase2(false);
|
||||
StartupEngines();
|
||||
|
@ -130,11 +130,27 @@ static void ConvertRoadTypes()
|
||||
}
|
||||
}
|
||||
|
||||
/** Populate label lists with current values. */
|
||||
static void SetCurrentLabelLists()
|
||||
{
|
||||
_railtype_list.clear();
|
||||
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
|
||||
_railtype_list.push_back({GetRailTypeInfo(rt)->label, 0});
|
||||
}
|
||||
|
||||
_roadtype_list.clear();
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
|
||||
_roadtype_list.push_back({GetRoadTypeInfo(rt)->label, GetRoadTramType(rt)});
|
||||
}
|
||||
}
|
||||
|
||||
/** Perform rail type and road type conversion if necessary. */
|
||||
void AfterLoadLabelMaps()
|
||||
{
|
||||
ConvertRailTypes();
|
||||
ConvertRoadTypes();
|
||||
|
||||
SetCurrentLabelLists();
|
||||
}
|
||||
|
||||
void ResetLabelMaps()
|
||||
|
Loading…
Reference in New Issue
Block a user