From a2d40869ebd465aada3cdbaa287c02f973176baa Mon Sep 17 00:00:00 2001 From: Dominik Morse Date: Sat, 31 Aug 2024 14:22:33 +0200 Subject: [PATCH 1/3] Reverted state to match broken --- .../Components/Interactable/ActorInteractableComponentBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp index 02a4651..e911f9b 100644 --- a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp @@ -1312,7 +1312,7 @@ void UActorInteractableComponentBase::InteractorLost_Implementation(const TScrip GetWorld()->GetTimerManager().ClearTimer(Timer_Interaction); GetWorld()->GetTimerManager().ClearTimer(Timer_ProgressExpiration); - //GetWorld()->GetTimerManager().ClearTimer(Timer_Cooldown); + GetWorld()->GetTimerManager().ClearTimer(Timer_Cooldown); if (GetOwner() && GetOwner()->HasAuthority()) { From 709cf954fd2b702a161b1c35e10953b552d5afae Mon Sep 17 00:00:00 2001 From: Dominik Morse Date: Sat, 31 Aug 2024 14:23:01 +0200 Subject: [PATCH 2/3] Fixed state issue --- .../Components/Interactable/ActorInteractableComponentBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp index e911f9b..9848caa 100644 --- a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp @@ -1312,7 +1312,8 @@ void UActorInteractableComponentBase::InteractorLost_Implementation(const TScrip GetWorld()->GetTimerManager().ClearTimer(Timer_Interaction); GetWorld()->GetTimerManager().ClearTimer(Timer_ProgressExpiration); - GetWorld()->GetTimerManager().ClearTimer(Timer_Cooldown); + + //GetWorld()->GetTimerManager().ClearTimer(Timer_Cooldown); if (GetOwner() && GetOwner()->HasAuthority()) { From 067e36e94f62e62d38499bcee7b908e2cb28174d Mon Sep 17 00:00:00 2001 From: Dominik Morse Date: Sat, 31 Aug 2024 15:55:01 +0200 Subject: [PATCH 3/3] Updated initialization --- .../ActorInteractableComponentBase.cpp | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp index 9848caa..ded77eb 100644 --- a/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp +++ b/Source/ActorInteractionPlugin/Private/Components/Interactable/ActorInteractableComponentBase.cpp @@ -66,17 +66,19 @@ UActorInteractableComponentBase::UActorInteractableComponentBase() : bVisualizeComponent = true; #endif -#if !UE_GAME -#if WITH_EDITOR - if (GIsEditor && !GIsPlayInEditorWorld && !bInteractableInitialized) +#if WITH_EDITOR && !UE_GAME + + if (!bInteractableInitialized) { - LOG_INFO(TEXT("[%s] Setting Default Values from Constructor"), *GetName()) - SetDefaultValues(); + if (GetOwner() == nullptr) + { + SetDefaultValues(); + } + + bInteractableInitialized = true; } -#endif #endif - bInteractableInitialized = true; } void UActorInteractableComponentBase::BeginPlay() @@ -1331,10 +1333,6 @@ void UActorInteractableComponentBase::InteractorLost_Implementation(const TScrip switch (InteractableState) { case EInteractableStateV2::EIS_Cooldown: - if (Execute_GetInteractor(this).GetObject() == nullptr) - { - Execute_SetState(this, DefaultInteractableState); - } break; case EInteractableStateV2::EIS_Asleep: case EInteractableStateV2::EIS_Suppressed: