From 776ddec77ca2da6aac6b00b8ba06173bd4fe48b5 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 12:50:13 -0500 Subject: [PATCH] fix(loot): drop the coins before the items Live sent a drop's currency DropClientLoot before its item drops in 1498 of 1502 live drop groups that had both. DLU sent the coins last. Co-Authored-By: Claude Opus 5.5 --- dGame/dUtilities/Loot.cpp | 52 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/dGame/dUtilities/Loot.cpp b/dGame/dUtilities/Loot.cpp index d81f2522d..64f8aa00d 100644 --- a/dGame/dUtilities/Loot.cpp +++ b/dGame/dUtilities/Loot.cpp @@ -363,31 +363,7 @@ void DropLoot(Entity* player, const LWOOBJID source, const std::map 0) EconomyLedger::RecordMapEvent(IEconomyLedger::eMapEvent::ITEM_DROPS, lootLot, spawnPosition, info.count, player); } - constexpr LOT TOKEN_PROXY = 13763; - // Go through the drops 1 at a time to drop them - for (auto it = rolledItems.begin(); it != rolledItems.end(); it++) { - auto& [lootLot, info] = *it; - for (int i = 0; i < info.count; i++) { - GameMessages::DropClientLoot lootMsg{}; - lootMsg.spawnPos = spawnPosition; - lootMsg.sourceID = source; - lootMsg.item = lootLot; - lootMsg.count = 1; - lootMsg.currency = 0; - const CDObjects& object = objectsTable->GetByID(lootLot); - - if (lootLot == TOKEN_PROXY) { - team ? DropFactionLoot(*team, lootMsg, noTeamLootOnDeath) : DropFactionLoot(*player, lootMsg); - } else if (info.table.MissionDrop) { - team ? DropMissionLoot(*team, lootMsg, noTeamLootOnDeath) : DropMissionLoot(*player, lootMsg); - } else if (object.type == "Powerup") { - team ? DropPowerupLoot(*team, lootMsg, noTeamLootOnDeath) : DropPowerupLoot(*player, lootMsg); - } else { - team ? DropRegularLoot(*team, lootMsg, noTeamLootOnDeath) : DropRegularLoot(*player, lootMsg); - } - } - } - + // Live sent the coins before the items (1498 of 1502 live drops with both) // Filter out dead player if we need to std::vector lootEarners; if (team) { @@ -429,6 +405,32 @@ void DropLoot(Entity* player, const LWOOBJID source, const std::mapGetEntity(member); if (memberEntity) lootMsg.Send(memberEntity->GetSystemAddress()); } + + constexpr LOT TOKEN_PROXY = 13763; + // Go through the drops 1 at a time to drop them + for (auto it = rolledItems.begin(); it != rolledItems.end(); it++) { + auto& [lootLot, info] = *it; + for (int i = 0; i < info.count; i++) { + GameMessages::DropClientLoot lootMsg{}; + lootMsg.spawnPos = spawnPosition; + lootMsg.sourceID = source; + lootMsg.item = lootLot; + lootMsg.count = 1; + lootMsg.currency = 0; + const CDObjects& object = objectsTable->GetByID(lootLot); + + if (lootLot == TOKEN_PROXY) { + team ? DropFactionLoot(*team, lootMsg, noTeamLootOnDeath) : DropFactionLoot(*player, lootMsg); + } else if (info.table.MissionDrop) { + team ? DropMissionLoot(*team, lootMsg, noTeamLootOnDeath) : DropMissionLoot(*player, lootMsg); + } else if (object.type == "Powerup") { + team ? DropPowerupLoot(*team, lootMsg, noTeamLootOnDeath) : DropPowerupLoot(*player, lootMsg); + } else { + team ? DropRegularLoot(*team, lootMsg, noTeamLootOnDeath) : DropRegularLoot(*player, lootMsg); + } + } + } + } void Loot::DropItem(Entity& player, GameMessages::DropClientLoot& lootMsg, bool useTeam, bool forceFfa) {