From 2ac00a16a0fe6ca66af84b1840567ce53c101adb Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 17 Oct 2010 20:29:25 +0000 Subject: [PATCH] (svn r20979) -Fix: [NewGRF] ignore the variable for action7/9 condition type 0x0D and 0x0E as documented --- src/newgrf.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 44ec6e3db6..9628fce847 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);