add ensure checks on the grab socket name

This commit is contained in:
Mamadou Babaei
2023-05-19 18:04:41 +02:00
parent 0906a60b66
commit caf9340641
@@ -1235,6 +1235,8 @@ void ASGPawn::GrabLeft(AActor* Actor)
};
FName SocketName{GrabComponent->GetAttachmentSocketName()};
ensureAlwaysMsgf(SocketName != NAME_None, TEXT("invalid attachment socket name!"));
Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentRules), MoveTemp(SocketName));
ActorLeftHandGrabbing = Actor;
@@ -1261,6 +1263,8 @@ void ASGPawn::GrabRight(AActor* Actor)
};
FName SocketName{GrabComponent->GetAttachmentSocketName()};
ensureAlwaysMsgf(SocketName != NAME_None, TEXT("invalid attachment socket name!"));
Actor->AttachToComponent(HandRight, MoveTemp(AttachmentRules), MoveTemp(SocketName));
ActorRightHandGrabbing = Actor;