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 Yexo
parent a9b3312d1a
commit f827bc8c1a
2 changed files with 4 additions and 4 deletions

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