summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-08-31 21:40:05 +0100
committerCharles Pigott <charlespigott@googlemail.com>2021-09-11 23:10:50 +0100
commit16dca0d7bc7a16f97067eb24722a90928b76efb5 (patch)
tree4cfd003a9f11bc5b5a7bb331ff664bd2a1816662
parentceaff9c9f200352048d22add9c1f4a923790b87b (diff)
downloadopenttd-16dca0d7bc7a16f97067eb24722a90928b76efb5.tar.xz
Codechange: Object non-zero dimension check was not logically correct
-rw-r--r--src/newgrf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 8d2f5f9f9..5ceadfd96 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;