Change: Do not allow mixing road/tram types in powered road type list (#11148)

Road/tram property 0F
This commit is contained in:
Jonathan G Rennison 2023-07-19 18:51:21 +01:00 committed by GitHub
parent 461b4b8861
commit f31a25cd59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -4484,7 +4484,13 @@ static ChangeInfoResult RoadTypeChangeInfo(uint id, int numinfo, int prop, ByteR
RoadType resolved_rt = GetRoadTypeByLabel(BSWAP32(label), false);
if (resolved_rt != INVALID_ROADTYPE) {
switch (prop) {
case 0x0F: SetBit(rti->powered_roadtypes, resolved_rt); break;
case 0x0F:
if (GetRoadTramType(resolved_rt) == rtt) {
SetBit(rti->powered_roadtypes, resolved_rt);
} else {
GrfMsg(1, "RoadTypeChangeInfo: Powered road type list: Road type {} road/tram type does not match road type {}, ignoring", resolved_rt, rt);
}
break;
case 0x18: SetBit(rti->introduction_required_roadtypes, resolved_rt); break;
case 0x19: SetBit(rti->introduces_roadtypes, resolved_rt); break;
}