mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user