summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 0377c0bc5..a9727d38d 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -5130,6 +5130,10 @@ static void NewSpriteGroup(ByteReader *buf)
group->lowest_randbit = buf->ReadByte();
byte num_groups = buf->ReadByte();
+ if (!HasExactlyOneBit(num_groups)) {
+ grfmsg(1, "NewSpriteGroup: Random Action 2 nrand should be power of 2");
+ }
+
for (uint i = 0; i < num_groups; i++) {
group->groups.push_back(GetGroupFromGroupID(setid, type, buf->ReadWord()));
}