mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix(loot): gate auto-loot sends per loot session
This commit is contained in:
parent
c1baffadf0
commit
9cd52c4dd7
2 changed files with 5 additions and 2 deletions
|
|
@ -19582,7 +19582,8 @@ void GameHandler::handleLootResponse(network::Packet& packet) {
|
|||
std::remove_if(pendingGameObjectLootOpens_.begin(), pendingGameObjectLootOpens_.end(),
|
||||
[&](const PendingLootOpen& p) { return p.guid == currentLoot.lootGuid; }),
|
||||
pendingGameObjectLootOpens_.end());
|
||||
localLootState_[currentLoot.lootGuid] = LocalLootState{currentLoot, false};
|
||||
auto& localLoot = localLootState_[currentLoot.lootGuid];
|
||||
localLoot.data = currentLoot;
|
||||
|
||||
// Query item info so loot window can show names instead of IDs
|
||||
for (const auto& item : currentLoot.items) {
|
||||
|
|
@ -19607,11 +19608,12 @@ void GameHandler::handleLootResponse(network::Packet& packet) {
|
|||
}
|
||||
|
||||
// Auto-loot items when enabled
|
||||
if (autoLoot_ && state == WorldState::IN_WORLD && socket) {
|
||||
if (autoLoot_ && state == WorldState::IN_WORLD && socket && !localLoot.itemAutoLootSent) {
|
||||
for (const auto& item : currentLoot.items) {
|
||||
auto pkt = AutostoreLootItemPacket::build(item.slotIndex);
|
||||
socket->send(pkt);
|
||||
}
|
||||
localLoot.itemAutoLootSent = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue