fix(quickbuild): the item cost is taken with the quickbuild as its source

Live's RemoveItemFromInventory for a quickbuild's item cost (the FV Stone
Warrior pedestal's 5 Maelstrom Infected Bricks, taken when the build starts)
had the loot source Quickbuild and the quickbuild's object ID as the loot
source object. DLU sent loot source None with no source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 07:46:13 -05:00
parent ed2d329781
commit a5126536a4

View File

@@ -664,9 +664,11 @@ void QuickBuildComponent::TakeItemCosts(Entity& user) {
if (!inventoryComponent) return;
// Live took the precondition items (for example the FV Stone Warrior pedestal's 5 Maelstrom Infected Bricks)
// when the build started and gave them back when it was cancelled
// when the build started and gave them back when it was cancelled. The removal names the quickbuild as its loot
// source (Quickbuild, the quickbuild's object ID), as live's did.
const ItemRemovalSource removalSource{ eLootSourceType::QUICKBUILD, m_Parent->GetObjectID() };
for (const auto& cost : m_Precondition->GetItemCosts(&user)) {
if (inventoryComponent->RemoveItem(cost.lot, cost.count, eInventoryType::ALL)) m_TakenItems.push_back(cost);
if (inventoryComponent->RemoveItem(cost.lot, cost.count, eInventoryType::ALL, false, false, removalSource)) m_TakenItems.push_back(cost);
}
if (!m_TakenItems.empty()) m_TakenItemsFrom = user.GetObjectID();
}