diff --git a/src/items/item.cpp b/src/items/item.cpp index eea07a4e5dd..81d24a790e7 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -1147,6 +1147,10 @@ Item::getDescriptions(const ItemType &it, std::shared_ptr item /*= nullptr descriptions.emplace_back("Description", it.description); } + if (item->getContainer()) { + descriptions.emplace_back("Capacity", std::to_string(item->getContainer()->capacity())); + } + if (it.showCharges) { auto charges = item->getAttribute(ItemAttribute_t::CHARGES); if (charges != 0) { @@ -1403,10 +1407,6 @@ Item::getDescriptions(const ItemType &it, std::shared_ptr item /*= nullptr descriptions.emplace_back("Tier", std::to_string(item->getTier())); } - if (item->getContainer()) { - descriptions.emplace_back("Capacity", std::to_string(item->getContainer()->capacity())); - } - std::string slotName; if (item->getImbuementSlot() > 0) { for (uint8_t i = 0; i < item->getImbuementSlot(); ++i) { @@ -1562,6 +1562,10 @@ Item::getDescriptions(const ItemType &it, std::shared_ptr item /*= nullptr descriptions.emplace_back("Description", it.description); } + if (it.isContainer()) { + descriptions.emplace_back("Capacity", std::to_string(it.maxItems)); + } + int32_t attack = it.attack; if (it.isRanged()) { bool separator = false; @@ -1781,10 +1785,6 @@ Item::getDescriptions(const ItemType &it, std::shared_ptr item /*= nullptr } } - if (it.isContainer()) { - descriptions.emplace_back("Capacity", std::to_string(it.maxItems)); - } - if (it.imbuementSlot > 0) { descriptions.emplace_back("Imbuement Slots", std::to_string(it.imbuementSlot)); } @@ -2075,13 +2075,18 @@ std::string Item::parseShowDuration(std::shared_ptr item) { std::string Item::parseShowAttributesDescription(std::shared_ptr item, const uint16_t itemId) { std::ostringstream itemDescription; const ItemType &itemType = Item::items[itemId]; + if (itemType.armor != 0 || (item && item->getArmor() != 0) || itemType.showAttributes) { - bool begin = true; + bool begin = itemType.isQuiver() ? false : true; int32_t armor = (item ? item->getArmor() : itemType.armor); if (armor != 0) { - itemDescription << " (Arm:" << armor; - begin = false; + if (begin) { + itemDescription << " (Arm:" << armor; + begin = false; + } else { + itemDescription << ", Arm:" << armor; + } } if (itemType.abilities) { @@ -2167,7 +2172,7 @@ std::string Item::parseShowAttributesDescription(std::shared_ptr item, con itemDescription << ", "; } - itemDescription << "Perfect Shot " << std::showpos << itemType.abilities->perfectShotDamage << std::noshowpos << " at range " << unsigned(itemType.abilities->perfectShotRange); + itemDescription << "perfect shot " << std::showpos << itemType.abilities->perfectShotDamage << std::noshowpos << " at range " << unsigned(itemType.abilities->perfectShotRange); } if (itemType.abilities->reflectFlat[0] != 0) { @@ -2869,8 +2874,10 @@ std::string Item::getDescription(const ItemType &it, int32_t lookDistance, std:: } } - if (volume != 0) { + if (volume != 0 && !it.isQuiver()) { s << " (Vol:" << volume << ')'; + } else if (volume != 0 && it.isQuiver()) { + s << " (Vol:" << volume; } } else { bool found = true; diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index db850af5ecc..3b133d68893 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -5643,7 +5643,7 @@ void ProtocolGame::sendMarketDetail(uint16_t itemId, uint8_t tier) { if (it.abilities->perfectShotDamage > 0) { string.clear(); - string << std::showpos << it.abilities->perfectShotDamage << std::noshowpos << " at " << it.abilities->perfectShotRange << "%"; + string << std::showpos << it.abilities->perfectShotDamage << std::noshowpos << " at range " << unsigned(it.abilities->perfectShotRange); msg.addString(string.str(), "ProtocolGame::sendMarketDetail - string.str()"); } else { msg.add(0x00);