add ensure checks on the grab socket name
This commit is contained in:
@@ -1235,6 +1235,8 @@ void ASGPawn::GrabLeft(AActor* Actor)
|
|||||||
};
|
};
|
||||||
FName SocketName{GrabComponent->GetAttachmentSocketName()};
|
FName SocketName{GrabComponent->GetAttachmentSocketName()};
|
||||||
|
|
||||||
|
ensureAlwaysMsgf(SocketName != NAME_None, TEXT("invalid attachment socket name!"));
|
||||||
|
|
||||||
Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentRules), MoveTemp(SocketName));
|
Actor->AttachToComponent(HandLeft, MoveTemp(AttachmentRules), MoveTemp(SocketName));
|
||||||
|
|
||||||
ActorLeftHandGrabbing = Actor;
|
ActorLeftHandGrabbing = Actor;
|
||||||
@@ -1261,6 +1263,8 @@ void ASGPawn::GrabRight(AActor* Actor)
|
|||||||
};
|
};
|
||||||
FName SocketName{GrabComponent->GetAttachmentSocketName()};
|
FName SocketName{GrabComponent->GetAttachmentSocketName()};
|
||||||
|
|
||||||
|
ensureAlwaysMsgf(SocketName != NAME_None, TEXT("invalid attachment socket name!"));
|
||||||
|
|
||||||
Actor->AttachToComponent(HandRight, MoveTemp(AttachmentRules), MoveTemp(SocketName));
|
Actor->AttachToComponent(HandRight, MoveTemp(AttachmentRules), MoveTemp(SocketName));
|
||||||
|
|
||||||
ActorRightHandGrabbing = Actor;
|
ActorRightHandGrabbing = Actor;
|
||||||
|
|||||||
Reference in New Issue
Block a user