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:
Yexo
2020-06-01 11:25:58 +02:00
committed by Charles Pigott
parent f4ed770cff
commit dd4aae830d
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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