Skip to content

Commit 36eaf88

Browse files
author
Roberto De Ioris
committed
fixed variable reuse in casting
1 parent 986de7e commit 36eaf88

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,16 +2826,16 @@ PyObject *ue_bind_pyevent(ue_PyUObject *u_obj, FString event_name, PyObject *py_
28262826
// re-assign multicast delegate
28272827
casted_prop->SetPropertyValue_InContainer(u_obj->ue_object, multiscript_delegate);
28282828
}
2829-
else if (auto casted_prop = Cast<UDelegateProperty>(u_property))
2829+
else if (auto casted_prop_delegate = Cast<UDelegateProperty>(u_property))
28302830
{
28312831

2832-
FScriptDelegate script_delegate = casted_prop->GetPropertyValue_InContainer(u_obj->ue_object);
2833-
UPythonDelegate *py_delegate = FUnrealEnginePythonHouseKeeper::Get()->NewDelegate(u_obj->ue_object, py_callable, casted_prop->SignatureFunction);
2832+
FScriptDelegate script_delegate = casted_prop_delegate->GetPropertyValue_InContainer(u_obj->ue_object);
2833+
UPythonDelegate *py_delegate = FUnrealEnginePythonHouseKeeper::Get()->NewDelegate(u_obj->ue_object, py_callable, casted_prop_delegate->SignatureFunction);
28342834
// fake UFUNCTION for bypassing checks
28352835
script_delegate.BindUFunction(py_delegate, FName("PyFakeCallable"));
28362836

28372837
// re-assign multicast delegate
2838-
casted_prop->SetPropertyValue_InContainer(u_obj->ue_object, script_delegate);
2838+
casted_prop_delegate->SetPropertyValue_InContainer(u_obj->ue_object, script_delegate);
28392839
}
28402840
else
28412841
{

0 commit comments

Comments
 (0)