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

This commit is contained in:
Michael Lutz
2025-06-13 21:19:34 +02:00
parent 3ac1a2f1e4
commit 1779da51c2

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;