From b50fc47b00bdc843310d07219a6dfb8404722dbe Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Mon, 23 Sep 2024 23:13:45 -0300 Subject: [PATCH] fix: items with only attack bug --- src/server/network/protocol/protocolgame.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index d2d31d4206d..f81fb2b21a0 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -5746,13 +5746,13 @@ void ProtocolGame::sendMarketDetail(uint16_t itemId, uint8_t tier) { attackDescription = fmt::format("{} {}", it.abilities->elementDamage, getCombatName(it.abilities->elementType)); } - if (it.attack != 0) { + if (it.attack != 0 && !attackDescription.empty()) { attackDescription = fmt::format("{} physical + {}", it.attack, attackDescription); + } else if (it.attack != 0 && attackDescription.empty()) { + attackDescription = std::to_string(it.attack); } - if (!attackDescription.empty()) { - msg.addString(attackDescription, "ProtocolGame::sendMarketDetail - attackDescription"); - } + msg.addString(attackDescription, "ProtocolGame::sendMarketDetail - attackDescription"); } else { msg.add(0x00); }