Updates
This commit is contained in:
@@ -8,11 +8,10 @@
|
||||
UGlobalSaveGameData* UGlobalSaveGameData::CreateNewSaveGame()
|
||||
{
|
||||
UGlobalSaveGameData* NewSave = Cast<UGlobalSaveGameData>(UGameplayStatics::CreateSaveGameObject(StaticClass()));
|
||||
NewSave->Money = STARTING_MONEY;
|
||||
|
||||
if (!NewSave)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return NewSave;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "GlobalSaveGameData.generated.h"
|
||||
|
||||
struct FItemSaveRecord;
|
||||
class UClothingList;
|
||||
|
||||
UCLASS()
|
||||
class NAKEDDESIRE_API UGlobalSaveGameData : public USaveGame
|
||||
@@ -32,7 +31,7 @@ public:
|
||||
UPROPERTY(SaveGame)
|
||||
TArray<FItemSaveRecord> EquippedItems;
|
||||
|
||||
UPROPERTY(SaceGame)
|
||||
UPROPERTY(SaveGame)
|
||||
int32 DaysPassed = 0;
|
||||
|
||||
UPROPERTY(SaveGame)
|
||||
|
||||
@@ -19,14 +19,10 @@ void USaveSubsystem::AddItem(const FItemSaveRecord& Record)
|
||||
|
||||
void USaveSubsystem::RemoveItem(const FGuid& InstanceId)
|
||||
{
|
||||
FItemSaveRecord* ItemSaveRecord = Items.FindByPredicate([InstanceId](FItemSaveRecord ItemSaveRecord)
|
||||
Items.RemoveAll([InstanceId](const FItemSaveRecord& Item)
|
||||
{
|
||||
return ItemSaveRecord.InstanceId == InstanceId;
|
||||
return Item.InstanceId == InstanceId;
|
||||
});
|
||||
if (ItemSaveRecord)
|
||||
{
|
||||
Items.Remove(*ItemSaveRecord);
|
||||
}
|
||||
}
|
||||
|
||||
void USaveSubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
||||
|
||||
Reference in New Issue
Block a user