summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2019-12-18 00:48:03 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-12-23 17:23:20 +0000
commit7f351fd7c1e853918d2ce7bfd1c9c6c5a2af84ef (patch)
tree707319bc88c9bc6419b816cf21af915f4b323c36
parentbc7f92815bf5e34bb1919d75a905211828e49645 (diff)
downloadopenttd-7f351fd7c1e853918d2ce7bfd1c9c6c5a2af84ef.tar.xz
Fix: Action7/9 conditions 0F..12 reported roadtypes as valid tramtypes and vice versa.
-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;
}
}