mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Send CMSG_LOOT_MONEY for online gold looting and replace action bar right-click removal with drag-to-ground
This commit is contained in:
parent
affb5f4f04
commit
0a26eef154
5 changed files with 67 additions and 12 deletions
|
|
@ -4164,13 +4164,13 @@ void GameHandler::handleLootResponse(network::Packet& packet) {
|
|||
if (currentLoot.gold > 0) {
|
||||
if (singlePlayerMode_) {
|
||||
addMoneyCopper(currentLoot.gold);
|
||||
currentLoot.gold = 0;
|
||||
} else if (state == WorldState::IN_WORLD && socket) {
|
||||
// Auto-loot gold by sending CMSG_LOOT_MONEY (server handles the rest)
|
||||
auto pkt = LootMoneyPacket::build();
|
||||
socket->send(pkt);
|
||||
currentLoot.gold = 0;
|
||||
}
|
||||
std::string msg = "You loot ";
|
||||
msg += std::to_string(currentLoot.getGold()) + "g ";
|
||||
msg += std::to_string(currentLoot.getSilver()) + "s ";
|
||||
msg += std::to_string(currentLoot.getCopper()) + "c.";
|
||||
addSystemChatMessage(msg);
|
||||
currentLoot.gold = 0; // Clear gold from loot window after collecting
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1928,6 +1928,11 @@ network::Packet AutoEquipItemPacket::build(uint8_t srcBag, uint8_t srcSlot) {
|
|||
return packet;
|
||||
}
|
||||
|
||||
network::Packet LootMoneyPacket::build() {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_LOOT_MONEY));
|
||||
return packet;
|
||||
}
|
||||
|
||||
network::Packet LootReleasePacket::build(uint64_t lootGuid) {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_LOOT_RELEASE));
|
||||
packet.writeUInt64(lootGuid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue