mirror of https://github.com/OpenTTD/OpenTTD
Change: Treat extended waypoint classes as 'WAYP' class.
This maps the extended custom waypoint clases (where the first byte of the label is 0xFF) to the standard 'WAYP' label, allowing use of them before the feature exists.pull/12618/head
parent
61342620bc
commit
7490284518
|
@ -1937,8 +1937,9 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
|||
}
|
||||
|
||||
/* Swap classid because we read it in BE meaning WAYP or DFLT */
|
||||
uint32_t classid = buf->ReadDWord();
|
||||
statspec->cls_id = StationClass::Allocate(BSWAP32(classid));
|
||||
uint32_t classid = BSWAP32(buf->ReadDWord());
|
||||
if (GB(classid, 24, 8) == 0xFF) classid = 'WAYP';
|
||||
statspec->cls_id = StationClass::Allocate(classid);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4838,8 +4839,9 @@ static ChangeInfoResult RoadStopChangeInfo(uint id, int numinfo, int prop, ByteR
|
|||
rs = _cur.grffile->roadstops[id + i].get();
|
||||
}
|
||||
|
||||
uint32_t classid = buf->ReadDWord();
|
||||
rs->cls_id = RoadStopClass::Allocate(BSWAP32(classid));
|
||||
uint32_t classid = BSWAP32(buf->ReadDWord());
|
||||
if (GB(classid, 24, 8) == 0xFF) classid = 'WAYP';
|
||||
rs->cls_id = RoadStopClass::Allocate(classid);
|
||||
rs->spec_id = id + i;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue