Clothing system refactor
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
#include "GlobalSaveGameData.h"
|
||||
#include "ItemSaveRecord.h"
|
||||
#include "StartingSaveData.h"
|
||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "NakedDesire/Items/ItemDefinition.h"
|
||||
#include "NakedDesire/Items/ItemInstance.h"
|
||||
#include "NakedDesire/Global/NakedDesireGameInstance.h"
|
||||
|
||||
void USaveSubsystem::LoadGame(const FString& SlotName)
|
||||
@@ -62,14 +62,15 @@ void USaveSubsystem::PopulateStartingData(UGlobalSaveGameData* Save) const
|
||||
if (!GameInstance || !GameInstance->StartingSaveData)
|
||||
return;
|
||||
|
||||
for (UClothingItem* ClothingDef : GameInstance->StartingSaveData->StartingClothing)
|
||||
for (UItemDefinition* Definition : GameInstance->StartingSaveData->StartingItems)
|
||||
{
|
||||
if (!ClothingDef)
|
||||
if (!Definition)
|
||||
continue;
|
||||
|
||||
UItemInstance* Instance = Definition->CreateInstance(Save);
|
||||
if (!Instance)
|
||||
continue;
|
||||
|
||||
// TODO: Refactor. Skip converting to ClothingItemInstance
|
||||
UClothingItemInstance* Instance = NewObject<UClothingItemInstance>(Save);
|
||||
Instance->Init(ClothingDef);
|
||||
Save->AddEquippedItem(Instance);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user