fix uat errors C4458 when building the virtual hand component

This commit is contained in:
Mamadou Babaei
2023-03-28 11:22:22 +02:00
parent 58712b48ad
commit 5213282f25
@@ -122,7 +122,7 @@ struct USGVirtualHandComponent::FImpl
bool UninitializeBackend() const;
bool CheckGlove() const;
void SetVisibility(bool bVisible) const;
void SetVisibility(bool bInVisible) const;
};
const TArray<TArray<FName>>& USGVirtualHandComponent::GetLeftHandFingerBoneNames()
@@ -206,10 +206,10 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
bHiddenInGameIfNoGloveDetected = false;
const FString SkeletalMeshPath{Pimpl->GetDefaultMeshPath()};
const ConstructorHelpers::FObjectFinder<USkeletalMesh> SkeletalMesh{*SkeletalMeshPath};
ensureAlwaysMsgf(SkeletalMesh.Succeeded() && SkeletalMesh.Object,
const ConstructorHelpers::FObjectFinder<USkeletalMesh> SkeletalMeshFinder{*SkeletalMeshPath};
ensureAlwaysMsgf(SkeletalMeshFinder.Succeeded() && SkeletalMeshFinder.Object,
TEXT("Failed to load the skeletal mesh: '%s'"), *SkeletalMeshPath);
Super::SetSkeletalMesh(SkeletalMesh.Object, true);
Super::SetSkeletalMesh(SkeletalMeshFinder.Object, true);
bBackendInitialized = false;
Glove = nullptr;
@@ -458,13 +458,13 @@ FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
{
const USkeletalMesh* SkeletalMesh{GetMesh()};
if (!IsValid(SkeletalMesh))
const USkeletalMesh* CurrentMesh{GetMesh()};
if (!IsValid(CurrentMesh))
{
return false;
}
const FString CurrentMeshPath(SkeletalMesh->GetPathName());
const FString CurrentMeshPath(CurrentMesh->GetPathName());
const FString LeftHandDefaultMeshPath(GetDefaultLeftHandMeshPath());
const FString LeftHandDefaultMeshPathOnly(GetDefaultLeftHandMeshPathOnly());
const FString RightHandDefaultMeshPath(GetDefaultRightHandMeshPath());
@@ -482,14 +482,14 @@ bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
{
const FString SkeletalMeshPath{GetDefaultMeshPath()};
USkeletalMesh* SkeletalMesh{
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *SkeletalMeshPath))
const FString DefaultMeshPath{GetDefaultMeshPath()};
USkeletalMesh* DefaultMesh{
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
};
ensureAlwaysMsgf(SkeletalMesh, TEXT("Failed to load the skeletal mesh: '%s'"), *SkeletalMeshPath);
ensureAlwaysMsgf(DefaultMesh, TEXT("Failed to load the skeletal mesh: '%s'"), *DefaultMeshPath);
return SkeletalMesh;
return DefaultMesh;
}
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
@@ -510,16 +510,16 @@ USkeletalMesh* USGVirtualHandComponent::FImpl::GetMesh() const
USkeleton* USGVirtualHandComponent::FImpl::GetSkeleton() const
{
USkeletalMesh* SkeletalMesh{GetMesh()};
ensureAlwaysMsgf(IsValid(SkeletalMesh), TEXT("Invalid SkeletalMesh object!"));
return SkeletalMesh->GetSkeleton();
USkeletalMesh* Mesh{GetMesh()};
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
return Mesh->GetSkeleton();
}
const FReferenceSkeleton& USGVirtualHandComponent::FImpl::GetRefSkeleton() const
{
const USkeletalMesh* SkeletalMesh{GetMesh()};
ensureAlwaysMsgf(IsValid(SkeletalMesh), TEXT("Invalid SkeletalMesh object!"));
return SkeletalMesh->GetRefSkeleton();
const USkeletalMesh* Mesh{GetMesh()};
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
return Mesh->GetRefSkeleton();
}
bool USGVirtualHandComponent::FImpl::InitializeBackend() const
@@ -665,9 +665,9 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
return bFoundGlove;
}
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bVisible) const
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) const
{
Owner->SetVisibility(bVisible, true);
Owner->SetVisibility(bInVisible, true);
}
void USGVirtualHandComponent::FImplDeleter::operator()(const FImpl* P) const