From 4899e93ef7734f2731705372b24b9d8c440aa788 Mon Sep 17 00:00:00 2001 From: kokekanon <114332266+kokekanon@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:15:28 -0300 Subject: [PATCH] fix: packets cyclopedia 13.10 https://github.com/otland/forgottenserver/pull/4868 --- modules/game_cyclopedia/cyclopedia_widgets.otui | 4 ++++ src/client/const.h | 1 + src/client/protocolgameparse.cpp | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/game_cyclopedia/cyclopedia_widgets.otui b/modules/game_cyclopedia/cyclopedia_widgets.otui index c395347d9c..c6f36db1ea 100644 --- a/modules/game_cyclopedia/cyclopedia_widgets.otui +++ b/modules/game_cyclopedia/cyclopedia_widgets.otui @@ -964,6 +964,10 @@ BosstiaryItem < UIWidget !text: tr('Track') text-auto-resize: true color: #C1C1C1 + @onSetup: | + if (g_game.getClientVersion() <= 1320) then + self:hide() + end @onCheckChange: | g_game.sendStatusTrackerBestiary(self:getParent():getId(),self:isChecked()) UICreature diff --git a/src/client/const.h b/src/client/const.h index 66a82f1821..4b912d4290 100644 --- a/src/client/const.h +++ b/src/client/const.h @@ -663,6 +663,7 @@ namespace Otc RESOURCE_PREY_WILDCARDS = 10, RESOURCE_DAILYREWARD_STREAK = 20, RESOURCE_DAILYREWARD_JOKERS = 21, + RESOURCE_CHARM_POINTS = 30, RESOURCE_TASK_HUNTING = 50, RESOURCE_FORGE_DUST = 70, RESOURCE_FORGE_SLIVER = 71, diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index fa10bb473d..064ff77462 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -708,7 +708,10 @@ void ProtocolGame::parseRequestPurchaseData(const InputMessagePtr& msg) void ProtocolGame::parseResourceBalance(const InputMessagePtr& msg) const { const auto type = static_cast(msg->getU8()); - const uint64_t value = msg->getU64(); + const uint64_t value = (type == Otc::RESOURCE_CHARM_POINTS && g_game.getClientVersion() < 1332) + ? msg->getU32() + : msg->getU64(); + m_localPlayer->setResourceBalance(type, value); } @@ -1454,7 +1457,10 @@ void ProtocolGame::parseBosstiaryInfo(const InputMessagePtr& msg) boss.category = msg->getU8(); boss.kills = msg->getU32(); msg->getU8(); - boss.isTrackerActived = msg->getU8(); + boss.isTrackerActived = 0; + if (g_game.getClientVersion() >= 1320) { + boss.isTrackerActived = msg->getU8(); + } bossData.emplace_back(boss); }