Send CMSG_LOOT_MONEY for online gold looting and replace action bar right-click removal with drag-to-ground

This commit is contained in:
Kelsi 2026-02-06 19:24:44 -08:00
parent affb5f4f04
commit 0a26eef154
5 changed files with 67 additions and 12 deletions

View file

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