Fix MoveInteractable input handling race condition
This commit is contained in:
parent
5a562a42ea
commit
c869f82fc0
Content
Misc
ImportTest
Interactables
Splash
UI
Source/Lost_Edge/Private/Interactable/Modificators
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before ![]() (image error) Size: 342 KiB After ![]() (image error) Size: 131 B ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 142 B After ![]() (image error) Size: 128 B ![]() ![]() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -97,6 +97,7 @@ void UMoveInteractableModificator::Unbind_Implementation()
|
||||
|
||||
void UMoveInteractableModificator::TurnOnHolding()
|
||||
{
|
||||
FScopeLock lock1(&critical);
|
||||
holding = true;
|
||||
ProcessState();
|
||||
distance = (player->GetCameraLocation() - actor->GetActorLocation()).Length();
|
||||
@ -105,6 +106,7 @@ void UMoveInteractableModificator::TurnOnHolding()
|
||||
}
|
||||
void UMoveInteractableModificator::TurnOffHolding()
|
||||
{
|
||||
FScopeLock lock1(&critical);
|
||||
holding = false;
|
||||
ProcessState();
|
||||
AMainGameModeBase::GetWidgetsManager()->AnimateInteractionHint(this, 0, EInputAnimatedWidgetAnimation::Unhold);
|
||||
@ -112,6 +114,7 @@ void UMoveInteractableModificator::TurnOffHolding()
|
||||
|
||||
void UMoveInteractableModificator::TurnOnRotating()
|
||||
{
|
||||
FScopeLock lock1(&critical);
|
||||
rotating = true;
|
||||
player->LockPlayer({ .camera = true });
|
||||
ProcessState();
|
||||
@ -120,6 +123,7 @@ void UMoveInteractableModificator::TurnOnRotating()
|
||||
}
|
||||
void UMoveInteractableModificator::TurnOffRotating()
|
||||
{
|
||||
FScopeLock lock1(&critical);
|
||||
rotating = false;
|
||||
player->UnlockPlayer({ .camera = true });
|
||||
ProcessState();
|
||||
@ -130,7 +134,8 @@ void UMoveInteractableModificator::ProcessState()
|
||||
{
|
||||
if(holding || rotating)
|
||||
{
|
||||
actor->activationLockers.Add(this);
|
||||
if(!actor->activationLockers.Contains(this))
|
||||
actor->activationLockers.Add(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -58,4 +58,5 @@ private:
|
||||
bool rotating = false;
|
||||
class AInteractable* actor = nullptr;
|
||||
class APlayerBase* player = nullptr;
|
||||
FCriticalSection critical;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user