Fixed savegame

This commit is contained in:
olehhapuk
2026-05-27 23:21:23 +03:00
parent d5a4e7e637
commit 94c8f91220
4 changed files with 21 additions and 24 deletions
+11 -14
View File
@@ -20,19 +20,6 @@ bool USaveSubsystem::SaveGame(const FString& SlotName) const
return UGlobalSaveGameData::SaveGame(CurrentSave, SlotName);
}
void USaveSubsystem::AddItem(const FItemSaveRecord& Record)
{
Items.Add(Record);
}
void USaveSubsystem::RemoveItem(const FGuid& InstanceId)
{
Items.RemoveAll([InstanceId](const FItemSaveRecord& Item)
{
return Item.InstanceId == InstanceId;
});
}
void USaveSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
@@ -56,6 +43,16 @@ UGlobalSaveGameData* USaveSubsystem::GetCurrentSave()
return CurrentSave;
}
void USaveSubsystem::BP_LoadGame()
{
LoadGame();
}
void USaveSubsystem::BP_SaveGame()
{
SaveGame();
}
void USaveSubsystem::PopulateStartingData(UGlobalSaveGameData* Save) const
{
if (!Save)
@@ -77,4 +74,4 @@ void USaveSubsystem::PopulateStartingData(UGlobalSaveGameData* Save) const
Record.Init(Instance);
Save->EquippedItems.Add(Record);
}
}
}