From 2ea9b94116425e7092a3bc070fa37357281766f9 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Fri, 3 Nov 2023 18:01:28 +0100 Subject: [PATCH] fix a bug where released actor is going to be null whenever the OnActorReleased event fires --- CHANGELOG.md | 4 ++++ Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76467961..8028ee1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a list of planned features and their completion status to the main README file. +### Fixed + +- A bug where released actor is going to be NULL whenever the OnActorReleased event fires. + ## [1.9.1] - 2023-10-11 ### Fixed diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index 58872351..765e814c 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -1977,9 +1977,9 @@ void ASGPawn::FImpl::Release(FSGGrabState& GrabState) const ApplyHandVelocityToGrabbedActor(GrabState); - SetGrabbedActor(GrabState, nullptr); - TriggerActorReleasedEvent(GrabState.Hand, GrabState.GrabbedActor); + + SetGrabbedActor(GrabState, nullptr); } void ASGPawn::FImpl::TriggerGrabStateUpdatedEvent(const FSGGrabState& GrabState) const