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.
This commit is contained in:
mimus-assa 2026-07-29 16:53:15 -06:00 committed by GitHub
parent af447efa36
commit 4bee667ed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: