1
0
Fork 0

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
Peter Nelson 2024-05-03 15:59:18 +01:00
parent 61342620bc
commit 7490284518
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 6 additions and 4 deletions

View File

@ -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;
}