Make sure owner and avatar implement interfaces in CanTransition

This commit is contained in:
Kevin Poretti 2023-10-18 22:44:04 -04:00
parent 6c06611901
commit c654bfd8fb

View File

@ -37,6 +37,11 @@ bool UFFState::CanTransition(const FFFStateContext& InStateContext)
return false; return false;
} }
} }
else
{
UE_LOG(LogTemp, Error, TEXT("CanTransition :: Avatar of FFFStateContext does not implement IFFStateAvatarInterface"));
return false;
}
IFFStateOwnerInterface* SOI = Cast<IFFStateOwnerInterface>(InStateContext.Owner); IFFStateOwnerInterface* SOI = Cast<IFFStateOwnerInterface>(InStateContext.Owner);
if(SOI) if(SOI)
@ -46,6 +51,11 @@ bool UFFState::CanTransition(const FFFStateContext& InStateContext)
return false; return false;
} }
} }
else
{
UE_LOG(LogTemp, Error, TEXT("CanTransition :: Owner of FFFStateContext does not implement IFFStateOwnerInterface"));
return false;
}
return OnCanTransition(InStateContext); return OnCanTransition(InStateContext);
} }