fix reestarting looting

This commit is contained in:
Milxnor
2023-04-16 11:15:10 -04:00
parent 228a06bd62
commit d308c9ad91
7 changed files with 44 additions and 14 deletions

View File

@@ -150,15 +150,15 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
if (bEnableStateValues)
{
FFortItemEntryStateValue* StateValue = (FFortItemEntryStateValue*)FMemory::Realloc(0, FFortItemEntryStateValue::GetStructSize(), 0);
// Alloc<FFortItemEntryStateValue>(FFortItemEntryStateValue::GetStructSize());
FFortItemEntryStateValue* StateValue = Alloc<FFortItemEntryStateValue>(FFortItemEntryStateValue::GetStructSize());
StateValue->GetIntValue() = bShowItemToast;
StateValue->GetStateType() = EFortItemEntryState::ShouldShowItemToast;
NewItemInstance->GetItemEntry()->GetStateValues().AddPtr(StateValue, FFortItemEntryStateValue::GetStructSize());
}
ItemInstances.Add(NewItemInstance);
GetItemList().GetReplicatedEntries().Add(*NewItemInstance->GetItemEntry(), FortItemEntrySize);
auto ReplicatedEntryIdx = GetItemList().GetReplicatedEntries().Add(*NewItemInstance->GetItemEntry(), FortItemEntrySize);
// GetItemList().GetReplicatedEntries().AtPtr(ReplicatedEntryIdx, FFortItemEntry::GetStructSize())->GetIsReplicatedCopy() = true;
if (WorldItemDefinition->IsValidLowLevel())
{