From bddd9b078c0f2888a20af12bedc4b83b9bfcf6ff Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Sun, 11 Apr 2021 22:41:16 +0300 Subject: [PATCH] fix capacity of OTC to no need divide by 100 and fix issue which got introduced with uh trap use target actions --- src/game.cpp | 3 +++ src/protocolgame.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index d956755..c4d0352 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -250,6 +250,9 @@ Thing* Game::internalGetThing(Player* player, const Position& pos, int32_t index else { thing = tile->getTopCreature(); } + if (!thing) { + thing = tile->getUseItem(index); + } break; } diff --git a/src/protocolgame.cpp b/src/protocolgame.cpp index 60b7057..6010ca1 100644 --- a/src/protocolgame.cpp +++ b/src/protocolgame.cpp @@ -1952,7 +1952,7 @@ void ProtocolGame::AddPlayerStats(NetworkMessage& msg) msg.add(std::min(player->getHealth(), std::numeric_limits::max())); msg.add(std::min(player->getMaxHealth(), std::numeric_limits::max())); - msg.add(player->getFreeCapacity() / 100); + msg.add(player->getFreeCapacity()); msg.add(std::min(player->getExperience(), 0x7FFFFFFF));