From 19affe76867e752afbdad6d0a13445624385d303 Mon Sep 17 00:00:00 2001 From: IcaroPimentel654 <145577637+IcaroPimentel654@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:38:26 -0300 Subject: [PATCH 1/3] Fix: GameCountU16 item max count was limited to uint8, when you have uint16 on server. --- src/client/item.h | 2 +- src/client/protocolgameparse.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/item.h b/src/client/item.h index 600fc47fdc..3cd8b1e059 100644 --- a/src/client/item.h +++ b/src/client/item.h @@ -150,7 +150,7 @@ class Item : public Thing void internalDraw(int animationPhase, const Point& dest, const Color& color, bool drawThings, bool isMarked, LightView* lightView = nullptr); void setConductor(); - uint8_t m_countOrSubType{ 0 }; + int m_countOrSubType{ 0 }; Color m_color{ Color::white }; diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index d1cc91d208..ae80a92a5f 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -2408,7 +2408,7 @@ void ProtocolGame::parseChannelEvent(const InputMessagePtr& msg) void ProtocolGame::parseItemInfo(const InputMessagePtr& msg) const { std::vector> list; - const uint8_t size = msg->getU8(); + const int size = msg->getU8(); for (int_fast32_t i = 0; i < size; ++i) { const auto& item = std::make_shared(); item->setId(msg->getU16()); From dfa5ec84347ba2dda60bf979cedcb1fc1672332a Mon Sep 17 00:00:00 2001 From: IcaroPimentel654 <145577637+IcaroPimentel654@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:55:56 -0300 Subject: [PATCH 2/3] Update protocolgameparse.cpp --- src/client/protocolgameparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index ae80a92a5f..d1cc91d208 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -2408,7 +2408,7 @@ void ProtocolGame::parseChannelEvent(const InputMessagePtr& msg) void ProtocolGame::parseItemInfo(const InputMessagePtr& msg) const { std::vector> list; - const int size = msg->getU8(); + const uint8_t size = msg->getU8(); for (int_fast32_t i = 0; i < size; ++i) { const auto& item = std::make_shared(); item->setId(msg->getU16()); From f34e1411df079728b1d530b72e16a837dffabac8 Mon Sep 17 00:00:00 2001 From: IcaroPimentel654 <145577637+IcaroPimentel654@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:06:44 -0300 Subject: [PATCH 3/3] Update item.h --- src/client/item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/item.h b/src/client/item.h index 3cd8b1e059..12d8693b5c 100644 --- a/src/client/item.h +++ b/src/client/item.h @@ -150,7 +150,7 @@ class Item : public Thing void internalDraw(int animationPhase, const Point& dest, const Color& color, bool drawThings, bool isMarked, LightView* lightView = nullptr); void setConductor(); - int m_countOrSubType{ 0 }; + uint16_t m_countOrSubType{ 0 }; Color m_color{ Color::white };