Updated observation logic

This commit is contained in:
koritsa
2026-05-30 15:35:59 +03:00
committed by koritsa
parent c7b99dee7f
commit 2969800966
9 changed files with 190 additions and 47 deletions
@@ -58,6 +58,30 @@ bool UClothingManager::IsBodyPartExposed(const EBodyPart BodyPart)
return true;
}
float UClothingManager::GetEffectiveCoverage(const EBodyPart BodyPart)
{
// GDD §6.3.2: effective coverage of a part = max() across garments that include it.
// A garment that doesn't cover the part contributes nothing; nothing covering it = 0.
float MaxCoverage = 0.0f;
for (const auto& [Slot, Instance] : EquippedClothing)
{
if (!Instance)
continue;
const UClothingItemDefinition* Definition = Instance->GetClothingItemDefinition();
if (!Definition)
continue;
for (const FBodyPartCoverage& Coverage : Definition->CoveredBodyParts)
{
if (Coverage.BodyPart == BodyPart)
MaxCoverage = FMath::Max(MaxCoverage, Coverage.Coverage);
}
}
return MaxCoverage;
}
void UClothingManager::HydrateClothing()
{
USaveSubsystem* SaveSubsystem = UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem<USaveSubsystem>();