Skip to content

Commit

Permalink
Updated initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlicekdominik committed Aug 31, 2024
1 parent 709cf95 commit 067e36e
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 067e36e

Please sign in to comment.