mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
game: fix LFG reward money display (copper→gold/silver/copper)
The SMSG_LFG_PLAYER_REWARD handler was printing raw copper value with a "g" suffix (e.g. "12345g") instead of converting to gold/silver/copper. Now formats as "1g 23s 45c" matching the standard WoW convention.
This commit is contained in:
parent
3e5760aefe
commit
d339734143
1 changed files with 14 additions and 2 deletions
|
|
@ -11411,8 +11411,20 @@ void GameHandler::handleLfgPlayerReward(network::Packet& packet) {
|
|||
uint32_t money = packet.readUInt32();
|
||||
uint32_t xp = packet.readUInt32();
|
||||
|
||||
std::string rewardMsg = "Dungeon Finder reward: " + std::to_string(money) + "g " +
|
||||
std::to_string(xp) + " XP";
|
||||
// Convert copper to gold/silver/copper
|
||||
uint32_t gold = money / 10000;
|
||||
uint32_t silver = (money % 10000) / 100;
|
||||
uint32_t copper = money % 100;
|
||||
char moneyBuf[64];
|
||||
if (gold > 0)
|
||||
snprintf(moneyBuf, sizeof(moneyBuf), "%ug %us %uc", gold, silver, copper);
|
||||
else if (silver > 0)
|
||||
snprintf(moneyBuf, sizeof(moneyBuf), "%us %uc", silver, copper);
|
||||
else
|
||||
snprintf(moneyBuf, sizeof(moneyBuf), "%uc", copper);
|
||||
|
||||
std::string rewardMsg = std::string("Dungeon Finder reward: ") + moneyBuf +
|
||||
", " + std::to_string(xp) + " XP";
|
||||
|
||||
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||
uint32_t rewardCount = packet.readUInt32();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue