Skip to content

Commit

Permalink
feat: update inventory UI listing
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed May 25, 2022
1 parent a155e54 commit c9c2bce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Code/client/Games/Skyrim/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,22 @@ void TESObjectREFR::AddOrRemoveItem(const Inventory::Entry& arEntry) noexcept
{
PlayerCharacter* pPlayer = PlayerCharacter::Get();

if (pPlayer->IsItemInInventory(objectId))
return;
if (!pPlayer->IsItemInInventory(objectId))
{
Actor* pActor = Cast<Actor>(this);
if (pActor && pActor->GetExtension()->IsRemotePlayer())
pPlayer->AddOrRemoveItem(arEntry);
}
}

Actor* pActor = Cast<Actor>(this);
if (!pActor || !pActor->GetExtension()->IsRemotePlayer())
return;
UpdateItemList(nullptr);
}

pPlayer->AddOrRemoveItem(arEntry);
}
void TESObjectREFR::UpdateItemList(TESForm* pUnkForm) noexcept
{
TP_THIS_FUNCTION(TUpdateItemList, void, TESObjectREFR, TESForm*);
POINTER_SKYRIMSE(TUpdateItemList, updateItemList, 52849);
ThisCall(updateItemList, this, pUnkForm);
}

void TESObjectREFR::Activate(TESObjectREFR* apActivator, uint8_t aUnk1, TESBoundObject* aObjectToGet, int32_t aCount, char aDefaultProcessing) noexcept
Expand Down
1 change: 1 addition & 0 deletions Code/client/Games/Skyrim/TESObjectREFR.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ struct TESObjectREFR : TESForm

void SetInventory(const Inventory& acContainer) noexcept;
void AddOrRemoveItem(const Inventory::Entry& arEntry) noexcept;
void UpdateItemList(TESForm* pUnkForm) noexcept;

BSHandleRefObject handleRefObject;
uintptr_t unk1C;
Expand Down

0 comments on commit c9c2bce

Please sign in to comment.