summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 19086e376..f4197c9aa 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -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;
}
}