mirror of https://github.com/OpenTTD/OpenTTD
Add: [NewGRF] Train property to set multiple track types for an engine.
parent
f468ec79da
commit
164423a424
|
@ -328,6 +328,22 @@ ChangeInfoResult RailVehicleChangeInfo(uint first, uint last, int prop, ByteRead
|
||||||
e->badges = ReadBadgeList(buf, GSF_TRAINS);
|
e->badges = ReadBadgeList(buf, GSF_TRAINS);
|
||||||
break;
|
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:
|
default:
|
||||||
ret = CommonVehicleChangeInfo(ei, prop, buf);
|
ret = CommonVehicleChangeInfo(ei, prop, buf);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue