From 0600fbe34b541855b300473193f7fee88c9e36ca Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 30 Nov 2025 09:12:29 +0000 Subject: [PATCH] Change: Explicitly reserve sprite group types >= 0x80. (#14836) The NewGRF spec does not mention that sprite group `type` and the `num-ent1` fields are the same. Reserve all unrecognised special types in case they are wanted at some point. --- src/newgrf/newgrf_act2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/newgrf/newgrf_act2.cpp b/src/newgrf/newgrf_act2.cpp index 9f99cdf4ee..5b1e61ab4b 100644 --- a/src/newgrf/newgrf_act2.cpp +++ b/src/newgrf/newgrf_act2.cpp @@ -525,6 +525,11 @@ static void NewSpriteGroup(ByteReader &buf) /* Neither a variable or randomized sprite group... must be a real group */ default: { + if (type >= 0x80) { + GrfMsg(0, "NewSpriteGroup: Reserved group type 0x{:02X}, skipping", type); + return; + } + switch (feature) { case GSF_TRAINS: case GSF_ROADVEHICLES: