Completed phase 1

This commit is contained in:
koritsa
2026-05-25 14:14:52 +03:00
parent 5d0bc7564c
commit 61c58c5c9f
22 changed files with 255 additions and 55 deletions
@@ -8,10 +8,10 @@
UGlobalSaveGameData* UGlobalSaveGameData::CreateNewSaveGame()
{
UGlobalSaveGameData* NewSave = Cast<UGlobalSaveGameData>(UGameplayStatics::CreateSaveGameObject(StaticClass()));
NewSave->Money = STARTING_MONEY;
if (!NewSave)
return nullptr;
NewSave->Money = STARTING_MONEY;
return NewSave;
}
@@ -41,12 +41,7 @@ UGlobalSaveGameData* UGlobalSaveGameData::LoadGame(const FString& SlotName)
return nullptr;
}
bool UGlobalSaveGameData::SaveGame(const FString& SlotName)
bool UGlobalSaveGameData::SaveGame(UGlobalSaveGameData* SaveGameData, const FString& SlotName)
{
if (UGlobalSaveGameData* Save = CreateNewSaveGame())
{
return UGameplayStatics::SaveGameToSlot(Save, SlotName, SLOT_PLAYER);
}
return false;
return UGameplayStatics::SaveGameToSlot(SaveGameData, SlotName, SLOT_PLAYER);
}