From d083ac11fa1d8bfc3fbe13f58d84fa9e5a46faac Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 24 Mar 2026 08:23:00 -0700 Subject: [PATCH] fix: suppress false-positive maskBlockCount warnings for VALUES updates VALUES update blocks don't carry an objectType field (it defaults to 0), so the sanity check incorrectly used the non-PLAYER threshold (10) for player character updates that legitimately need 42-46 mask blocks. Allow up to 55 blocks for VALUES updates (could be any entity type including PLAYER). Only enforce strict limits on CREATE_OBJECT blocks where the objectType is known. --- src/game/world_packets.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index 2bd63baa..eaeb3a44 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -1248,8 +1248,14 @@ bool UpdateObjectParser::parseUpdateFields(network::Packet& packet, UpdateBlock& } // Sanity check: UNIT_END=148 needs 5 mask blocks, PLAYER_END=1472 needs 46. - // Values significantly above these indicate the movement block was misparsed. - uint8_t maxExpectedBlocks = (block.objectType == ObjectType::PLAYER) ? 55 : 10; + // VALUES updates don't carry objectType (defaults to 0), so allow up to 55 + // for any VALUES update (could be a PLAYER). Only flag CREATE_OBJECT blocks + // with genuinely excessive block counts. + bool isCreateBlock = (block.updateType == UpdateType::CREATE_OBJECT || + block.updateType == UpdateType::CREATE_OBJECT2); + uint8_t maxExpectedBlocks = isCreateBlock + ? ((block.objectType == ObjectType::PLAYER) ? 55 : 10) + : 55; // VALUES: allow PLAYER-sized masks if (blockCount > maxExpectedBlocks) { LOG_WARNING("UpdateObjectParser: suspicious maskBlockCount=", (int)blockCount, " for objectType=", (int)block.objectType,