Add inventory persistence restore hook
This commit is contained in:
@@ -136,6 +136,17 @@ bool UAgrarianInventoryComponent::SplitStackByIndex(int32 StackIndex, int32 Spli
|
||||
return true;
|
||||
}
|
||||
|
||||
void UAgrarianInventoryComponent::RestoreSavedItems(const TArray<FAgrarianItemStack>& SavedItems)
|
||||
{
|
||||
if (!GetOwner() || !GetOwner()->HasAuthority())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Items = SavedItems;
|
||||
BroadcastInventoryChanged();
|
||||
}
|
||||
|
||||
void UAgrarianInventoryComponent::ServerAddItem_Implementation(const FAgrarianItemStack& Stack)
|
||||
{
|
||||
AddItem(Stack);
|
||||
|
||||
Reference in New Issue
Block a user