proper vending machines like fully, performance
This commit is contained in:
Milxnor
2023-05-08 22:28:32 -04:00
parent d5c95ac978
commit b64f569551
22 changed files with 399 additions and 221 deletions

View File

@@ -115,6 +115,7 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
CreateData.SpawnLocation = Pawn->GetActorLocation();
CreateData.PawnOwner = Cast<AFortPawn>(Pawn);
CreateData.SourceType = EFortPickupSourceTypeFlag::GetPlayerValue();
CreateData.bShouldFreeItemEntryWhenDeconstructed = true;
AFortPickup::SpawnPickup(CreateData);
return std::make_pair(NewItemInstances, ModifiedItemInstances);
@@ -238,7 +239,13 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
auto ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, Count, LoadedAmmo);
auto Ret = AddItem(ItemEntry, bShouldUpdate, bShowItemToast);
// VirtualFree(ItemEntry);
if (!bUseFMemoryRealloc)
{
FFortItemEntry::FreeItemEntry(ItemEntry);
VirtualFree(ItemEntry, 0, MEM_RELEASE);
}
return Ret;
}