fix uat errors C4458 when building the virtual hand component

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