From 4bee667ed492f8fda3876b58762333e2b0169160 Mon Sep 17 00:00:00 2001 From: mimus-assa <73607556+mimus-assa@users.noreply.github.com> Date: Wed, 29 Jul 2026 16:53:15 -0600 Subject: [PATCH] fix: read the full MonkData Virtue payload (count u8 + virtue id u16) (#1788) Bug Fixes: - Improved handling of monk virtue data so multiple virtues are read and processed correctly. - Prevented incorrect parsing of game messages containing multiple virtue entries. --- src/client/protocolgameparse.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index a07af7547..61973f919 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -5140,8 +5140,14 @@ void ProtocolGame::parseMonkData(const InputMessagePtr& msg) { break; } case Otc::TYPES_MONK_VIRTUE: { - const uint8_t virtueValue = msg->getU8(); - g_logger.debug("Unused {} TO-DO L4381", virtueValue); + // official format: count (u8) followed by one u16 virtue id per entry. + // Reading only the count desynced the stream and dropped the rest of + // the login bundle (VIP groups/list) for monk characters. + const uint8_t virtueCount = msg->getU8(); + for (uint8_t i = 0; i < virtueCount; ++i) { + const uint16_t virtueId = msg->getU16(); + g_logger.debug("Unused virtue {} TO-DO L4381", virtueId); + } break; } default: