FStateTreeCompareEnumCondition crash fix

There’s a crash bug in FStateTreeCompareEnumCondition that looks like a copy/paste error. The circled bit should be InstanceData->Right.Enum

[Image Removed]

[Attachment Removed]

Hello [mention removed]​,

Thanks for reporting this isssue. After reviewing the code in FStateTreeCompareEnumCondition::GetDescription, it does seem like this behavior is caused by an unintended mix-up in the code. The same logic remains unchanged in UE5-Main.

To help me investigate further and confirm the bug, could you please provide detailed repro steps or a minimal project to reproduce this issue?

Please let me know.

Best,

Francisco

[Attachment Removed]

I encountered it by resetting the “Right” property, once an enum is selected in the left property

[Image Removed]

[Attachment Removed]

Thanks [mention removed]​,

I was able to reproduce the crash in 5.6, 5.7 and a recent source build from UE5-Main (CL 50708264).

I’ve gone ahead and submitted a bug report for this issue. This appears be a mistake in the code for FStateTreeCompareEnumCondition::GetDescription.

You will be able to track the resolution of this bug in the following link: https://issues.unrealengine.com/issue/UE-365187. Please note that newly created tickets may take some time before being made public and addressed by the engine team.

In the meantime, you can resolve the issue by updating the Right value assignment in FStateTreeCompareEnumCondition::GetDescription as follows:

FText RightValue = BindingLookup.GetBindingSourceDisplayName(FPropertyBindingPath(ID, GET_MEMBER_NAME_CHECKED(FInstanceDataType, Right)), Formatting);
	if (RightValue.IsEmpty())
	{
		if (InstanceData->Right.Enum)
		{
			RightValue = InstanceData->Right.Enum->GetDisplayNameTextByValue(InstanceData->Right.Value);
		}
		else
		{
			RightValue = LOCTEXT("None", "None");
		}
	}

This fix has been referenced in the bug report submitted to the engine team.

Please let me know if this information helps or if you need anything else. Otherwise, I’ll go ahead and close this case.

Best,

Francisco.

[Attachment Removed]