Completed phase 1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user