Added ClothingItemInstance and cleanup the project
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "ExposeBodyPartRestriction.h"
|
||||
|
||||
#include "NakedDesire/Clothing/ClothingItemData.h"
|
||||
#include "NakedDesire/Clothing/ClothingItem.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
#include "NakedDesire/Clothing/ClothingManager.h"
|
||||
|
||||
@@ -40,20 +41,18 @@ FText UExposeBodyPartRestriction::GetDescription() const
|
||||
});
|
||||
}
|
||||
|
||||
void UExposeBodyPartRestriction::EquipClothing(const UClothingItemData* ClothingData)
|
||||
void UExposeBodyPartRestriction::EquipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
if (IsSuccess && ClothingData->Info->CoveredBodyParts.Contains(BodyPart))
|
||||
if (IsSuccess && ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(BodyPart))
|
||||
{
|
||||
Init(Player);
|
||||
}
|
||||
}
|
||||
|
||||
void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemData* ClothingData)
|
||||
void UExposeBodyPartRestriction::UnequipClothing(const UClothingItemInstance* ClothingItemInstance)
|
||||
{
|
||||
if (IsSuccess)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CheckClothing();
|
||||
}
|
||||
@@ -67,9 +66,9 @@ void UExposeBodyPartRestriction::CheckClothing()
|
||||
|
||||
const FClothingSlotData* TargetClothingItem = Player->ClothingManager->ClothingSlots.FindByPredicate([this](const FClothingSlotData& ClothingSlot)
|
||||
{
|
||||
if (ClothingSlot.ClothingData)
|
||||
if (ClothingSlot.ClothingItemInstance)
|
||||
{
|
||||
return ClothingSlot.ClothingData->Info->CoveredBodyParts.Contains(BodyPart);
|
||||
return ClothingSlot.ClothingItemInstance->GetClothingItem()->CoveredBodyParts.Contains(BodyPart);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user