Added ClothingItemInstance and cleanup the project
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
#include "NakedDesireGameMode.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
#include "NakedDesire/Interactables/Wardrobe.h"
|
||||
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
|
||||
@@ -19,7 +20,7 @@ AWardrobe* ANakedDesireGameMode::GetWardrobe() const
|
||||
return Wardrobe;
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
|
||||
void ANakedDesireGameMode::BuyItem(UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
if (!Player)
|
||||
@@ -27,13 +28,13 @@ void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player->Money < ClothingItem->Info->BasePrice)
|
||||
if (Player->Money < ClothingItemInstance->GetClothingItem()->BasePrice)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player->Money -= ClothingItem->Info->BasePrice;
|
||||
Wardrobe->ClothingItems.Add(ClothingItem);
|
||||
Player->Money -= ClothingItemInstance->GetClothingItem()->BasePrice;
|
||||
Wardrobe->ClothingItems.Add(ClothingItemInstance);
|
||||
}
|
||||
|
||||
void ANakedDesireGameMode::OnHourChanged(int32 Hour)
|
||||
|
||||
Reference in New Issue
Block a user