Fix: Action7/9 conditions 0F..12 reported roadtypes as valid tramtypes and vice versa.

This commit is contained in:
frosch 2019-12-18 00:48:03 +01:00 committed by Charles Pigott
parent bc7f92815b
commit 7f351fd7c1

View File

@ -6622,15 +6622,26 @@ static void SkipIf(ByteReader *buf)
break;
case 0x0E: result = GetRailTypeByLabel(BSWAP32(cond_val)) != INVALID_RAILTYPE;
break;
case 0x0F: result = GetRoadTypeByLabel(BSWAP32(cond_val)) == INVALID_ROADTYPE;
case 0x0F: {
RoadType rt = GetRoadTypeByLabel(BSWAP32(cond_val));
result = rt == INVALID_ROADTYPE || !RoadTypeIsRoad(rt);
break;
case 0x10: result = GetRoadTypeByLabel(BSWAP32(cond_val)) != INVALID_ROADTYPE;
}
case 0x10: {
RoadType rt = GetRoadTypeByLabel(BSWAP32(cond_val));
result = rt != INVALID_ROADTYPE && RoadTypeIsRoad(rt);
break;
case 0x11: result = GetRoadTypeByLabel(BSWAP32(cond_val)) == INVALID_ROADTYPE;
}
case 0x11: {
RoadType rt = GetRoadTypeByLabel(BSWAP32(cond_val));
result = rt == INVALID_ROADTYPE || !RoadTypeIsTram(rt);
break;
case 0x12: result = GetRoadTypeByLabel(BSWAP32(cond_val)) != INVALID_ROADTYPE;
}
case 0x12: {
RoadType rt = GetRoadTypeByLabel(BSWAP32(cond_val));
result = rt != INVALID_ROADTYPE && RoadTypeIsTram(rt);
break;
}
default: grfmsg(1, "SkipIf: Unsupported condition type %02X. Ignoring", condtype); return;
}
}