fix capacity of OTC to no need divide by 100 and fix issue which got introduced with uh trap use target actions

This commit is contained in:
ErikasKontenis 2021-04-11 22:41:16 +03:00
parent 27e146d222
commit bddd9b078c
2 changed files with 4 additions and 1 deletions

View File

@ -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;
}

View File

@ -1952,7 +1952,7 @@ void ProtocolGame::AddPlayerStats(NetworkMessage& msg)
msg.add<uint16_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint16_t>::max()));
msg.add<uint16_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint16_t>::max()));
msg.add<uint16_t>(player->getFreeCapacity() / 100);
msg.add<uint16_t>(player->getFreeCapacity());
msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF));