Add auto loot setting to gameplay settings

Checkbox in Settings > Gameplay > Loot section. When enabled, all items
are automatically sent CMSG_AUTOSTORE_LOOT_ITEM on loot response (same
as right-click looting each item). Gold always auto-loots regardless.
Setting persists in settings.cfg as auto_loot=0/1.
This commit is contained in:
Kelsi 2026-02-17 16:31:00 -08:00
parent a55399fad6
commit 0e18c8871d
4 changed files with 29 additions and 0 deletions

View file

@ -8190,6 +8190,14 @@ void GameHandler::handleLootResponse(network::Packet& packet) {
currentLoot.gold = 0;
}
}
// Auto-loot items when enabled
if (autoLoot_ && state == WorldState::IN_WORLD && socket) {
for (const auto& item : currentLoot.items) {
auto pkt = AutostoreLootItemPacket::build(item.slotIndex);
socket->send(pkt);
}
}
}
void GameHandler::handleLootReleaseResponse(network::Packet& packet) {