Skip to content

Commit

Permalink
fix: remove item
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Mar 15, 2022
1 parent b87775d commit 573d136
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Code/client/Games/Skyrim/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,12 @@ void TESObjectREFR::AddOrRemoveItem(const Inventory::Entry& arEntry) noexcept
if (arEntry.Count > 0)
{
AddObjectToContainer(pObject, pExtraDataList, arEntry.Count, nullptr);
spdlog::critical("Adding item {:X} with count {} to {:X}", pObject->formID, arEntry.Count, formID);
}
else if (arEntry.Count < 0)
{
RemoveItem(pObject, arEntry.Count, ITEM_REMOVE_REASON::kRemove, pExtraDataList, nullptr);
RemoveItem(pObject, -arEntry.Count, ITEM_REMOVE_REASON::kRemove, pExtraDataList, nullptr);
spdlog::warn("Removing item {:X} with count {} from {:X}", pObject->formID, arEntry.Count, formID);
}
}

Expand Down
3 changes: 3 additions & 0 deletions Code/client/Services/Generic/InventoryService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ void InventoryService::OnInventoryChangeEvent(const InventoryChangeEvent& acEven
request.Item = std::move(acEvent.Item);

m_transport.Send(request);

spdlog::info("Sending item request, item: {:X}, count: {}, actor: {:X}", acEvent.Item.BaseId.BaseId, acEvent.Item.Count,
acEvent.FormId);
}

void InventoryService::OnEquipmentChangeEvent(const EquipmentChangeEvent& acEvent) noexcept
Expand Down
1 change: 1 addition & 0 deletions Code/client/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ std::optional<Actor*> GetActorByServerId(const uint32_t aServerId) noexcept
}
}

spdlog::warn("Actor not found for server id {:X}", aServerId);
return std::nullopt;
}
}

0 comments on commit 573d136

Please sign in to comment.