From 16dca0d7bc7a16f97067eb24722a90928b76efb5 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Tue, 31 Aug 2021 21:40:05 +0100 Subject: [PATCH] Codechange: Object non-zero dimension check was not logically correct --- src/newgrf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 8d2f5f9f90..5ceadfd961 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4085,8 +4085,8 @@ static ChangeInfoResult ObjectChangeInfo(uint id, int numinfo, int prop, ByteRea case 0x0C: // Size spec->size = buf->ReadByte(); - if ((spec->size & 0xF0) == 0 || (spec->size & 0x0F) == 0) { - grfmsg(1, "ObjectChangeInfo: Invalid object size requested (%u) for object id %u. Ignoring.", spec->size, id + i); + if (GB(spec->size, 0, 4) == 0 || GB(spec->size, 4, 4) == 0) { + grfmsg(0, "ObjectChangeInfo: Invalid object size requested (0x%x) for object id %u. Ignoring.", spec->size, id + i); spec->size = 0x11; // 1x1 } break;