Fix #8166: don't crash on loading an invalid roadtype newgrf
Initialization code for GRFFile::roadtype_map was copied from railtype_map. But while RailType is a byte-sized enum and could thus be initialized via memset, RoadType doesn't have a defined size.
This commit is contained in:
@@ -132,7 +132,7 @@ struct GRFFile : ZeroedMemoryAllocator {
|
||||
std::vector<RoadTypeLabel> roadtype_list; ///< Roadtype translation table (road)
|
||||
RoadType roadtype_map[ROADTYPE_END];
|
||||
|
||||
std::vector<RoadTypeLabel> tramtype_list; ///, Roadtype translation table (tram)
|
||||
std::vector<RoadTypeLabel> tramtype_list; ///< Roadtype translation table (tram)
|
||||
RoadType tramtype_map[ROADTYPE_END];
|
||||
|
||||
CanalProperties canal_local_properties[CF_END]; ///< Canal properties as set by this NewGRF
|
||||
|
Reference in New Issue
Block a user