From 3b9015ef7ae223746e5d846511a25bea53cdc461 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 13 Feb 2023 23:49:53 +0000 Subject: [PATCH] Fix successfully mapped properties in HandleAction0PropertyDefault --- src/newgrf.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 60a7d5c447..d5cd8e46aa 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -912,16 +912,13 @@ typedef ChangeInfoResult (*VCI_Handler)(uint engine, int numinfo, int prop, cons static ChangeInfoResult HandleAction0PropertyDefault(ByteReader *buf, int prop) { - switch (prop) { - case A0RPI_UNKNOWN_IGNORE: - buf->Skip(buf->ReadExtendedByte()); - return CIR_SUCCESS; - - case A0RPI_UNKNOWN_ERROR: - return CIR_DISABLED; - - default: - return CIR_UNKNOWN; + if (prop == A0RPI_UNKNOWN_ERROR) { + return CIR_DISABLED; + } else if (prop < A0RPI_UNKNOWN_IGNORE) { + return CIR_UNKNOWN; + } else { + buf->Skip(buf->ReadExtendedByte()); + return CIR_SUCCESS; } }