File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -56,17 +56,22 @@ namespace RE
5656
5757 [[nodiscard]] TESBoundObject* GetInventoryObject (const std::uint32_t & a_handleID) const
5858 {
59- using func_t = bool (*)(const BGSInventoryInterface*, const std::uint32_t *, std::uint64_t ***);
60- static REL::Relocation<func_t > subfn{ ID::BGSInventoryInterface::GetInventoryObjectSub };
59+ struct UnkStruct
60+ {
61+ TESBoundObject** ppObj;
62+ std::uint64_t unk08;
63+ };
6164
6265 std::uint32_t handle = a_handleID;
63- std::uint64_t out = 0 ;
64- std::uint64_t * outarr[2 ];
65- std::uint64_t ** pout;
66- outarr[0 ] = &out;
67- pout = (std::uint64_t **)&outarr;
68- subfn (this , &handle, &pout);
69- return reinterpret_cast <TESBoundObject*>(out);
66+ TESBoundObject* pObj = 0 ;
67+ UnkStruct outstruct = { .ppObj = &pObj, .unk08 = 0 };
68+ UnkStruct* pOutstruct = &outstruct;
69+
70+ using func_t = bool (*)(const BGSInventoryInterface*, const std::uint32_t *, UnkStruct**);
71+ static REL::Relocation<func_t > GetInventoryObjectHelperFn{ ID::BGSInventoryInterface::GetInventoryObjectSub };
72+ GetInventoryObjectHelperFn (this , &handle, &pOutstruct);
73+
74+ return pObj;
7075 }
7176
7277 virtual ~BGSInventoryInterface (); // 00
You can’t perform that action at this time.
0 commit comments