summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 44ec6e3db..9628fce84 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5062,12 +5062,13 @@ static void SkipIf(ByteReader *buf)
/*
* Parameter (variable in specs) 0x88 can only have GRF ID checking
- * conditions, except conditions 0x0B and 0x0C (cargo availability)
- * as those ignore the parameter. So, when the condition type is
- * either of those, the specific variable 0x88 code is skipped, so
- * the "general" code for the cargo availability conditions kicks in.
+ * conditions, except conditions 0x0B, 0x0C (cargo availability) and
+ * 0x0D, 0x0E (Rail type availability) as those ignore the parameter.
+ * So, when the condition type is one of those, the specific variable
+ * 0x88 code is skipped, so the "general" code for the cargo
+ * availability conditions kicks in.
*/
- if (param == 0x88 && condtype != 0x0B && condtype != 0x0C) {
+ if (param == 0x88 && (condtype < 0x0B || condtype > 0x0E)) {
/* GRF ID checks */
GRFConfig *c = GetGRFConfig(cond_val, mask);