1
0
Fork 0

Add: [NewGRF] Train property to set multiple track types for an engine.

pull/14357/head
Michael Lutz 2025-06-13 21:19:34 +02:00
parent f468ec79da
commit 164423a424
1 changed files with 16 additions and 0 deletions

View File

@ -328,6 +328,22 @@ ChangeInfoResult RailVehicleChangeInfo(uint first, uint last, int prop, ByteRead
e->badges = ReadBadgeList(buf, GSF_TRAINS);
break;
case 0x34: { // List of track types
uint8_t count = buf.ReadByte();
_gted[e->index].railtypelabels.clear();
while (count--) {
uint8_t tracktype = buf.ReadByte();
if (tracktype < _cur_gps.grffile->railtype_list.size()) {
_gted[e->index].railtypelabels.push_back(_cur_gps.grffile->railtype_list[tracktype]);
} else {
GrfMsg(1, "RailVehicleChangeInfo: Invalid track type {} specified, ignoring", tracktype);
}
}
break;
}
default:
ret = CommonVehicleChangeInfo(ei, prop, buf);
break;