fix error C2440: 'initializing': cannot convert from 'void' to 'bool' when engine versio is < 5.2

This commit is contained in:
Mamadou Babaei
2023-06-01 21:46:23 +02:00
parent c3d6f25676
commit 21dfe0eb89
@@ -1141,6 +1141,7 @@ void ASGPawn::Grab(USGVirtualHandComponent* Hand, AActor* Actor)
Pimpl->DisableActorPhysics(Actor);
}
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
const bool bAttached = Actor->AttachToComponent(Hand, MoveTemp(AttachmentRules), SocketName);
if (bAttached)
{
@@ -1150,6 +1151,10 @@ void ASGPawn::Grab(USGVirtualHandComponent* Hand, AActor* Actor)
{
SGLOG_ERROR("Failed to grab the actor with the left hand!", Actor, SocketName);
}
#else
Actor->AttachToComponent(Hand, MoveTemp(AttachmentRules), SocketName);
LeftHandGrabState.GrabbedActor = Actor;
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
}
void ASGPawn::ReleaseLeft()