From ce6402046eca762a6e7351928008f598487a4087 Mon Sep 17 00:00:00 2001 From: getnamo Date: Tue, 19 May 2020 21:01:48 -0700 Subject: [PATCH] 4.25 update - FProperty change was quite substantial for the plugin - not fully thoroughly tested, CopyPropertyToPinnedBuffer and cleanup may not function as expected if assumptions on e.g. add to root are not held --- GlobalEventSystem.uplugin | 2 +- .../Private/GESDataTypes.cpp | 6 +- .../GlobalEventSystem/Private/GESHandler.cpp | 66 +++++++++---------- Source/GlobalEventSystem/Private/GESHandler.h | 6 +- .../Private/GlobalEventSystemBPLibrary.cpp | 54 +++++++-------- .../GlobalEventSystem/Public/GESDataTypes.h | 6 +- .../Public/GlobalEventSystemBPLibrary.h | 19 +++--- 7 files changed, 78 insertions(+), 81 deletions(-) diff --git a/GlobalEventSystem.uplugin b/GlobalEventSystem.uplugin index 9e26921..1027646 100644 --- a/GlobalEventSystem.uplugin +++ b/GlobalEventSystem.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "0.4.0", + "VersionName": "0.5.0", "FriendlyName": "GlobalEventSystem", "Description": "Loosely coupled internal event system plugin for the unreal engine.", "Category": "Other", diff --git a/Source/GlobalEventSystem/Private/GESDataTypes.cpp b/Source/GlobalEventSystem/Private/GESDataTypes.cpp index 8642765..5dca21a 100644 --- a/Source/GlobalEventSystem/Private/GESDataTypes.cpp +++ b/Source/GlobalEventSystem/Private/GESDataTypes.cpp @@ -3,7 +3,7 @@ void FGESPinnedData::CopyPropertyToPinnedBuffer() { //Copy this property data to temp - Property->AddToRoot(); + //Property->AddToRoot(); int32 Num = Property->GetSize(); PropertyData.SetNumUninitialized(Num); FMemory::Memcpy(PropertyData.GetData(), PropertyPtr, Num); @@ -14,10 +14,6 @@ void FGESPinnedData::CopyPropertyToPinnedBuffer() void FGESPinnedData::CleanupPinnedData() { - if (Property && Property->IsValidLowLevelFast()) - { - Property->RemoveFromRoot(); - } PropertyData.Empty(); Property = nullptr; PropertyPtr = nullptr; diff --git a/Source/GlobalEventSystem/Private/GESHandler.cpp b/Source/GlobalEventSystem/Private/GESHandler.cpp index 5354ef5..7f0a386 100644 --- a/Source/GlobalEventSystem/Private/GESHandler.cpp +++ b/Source/GlobalEventSystem/Private/GESHandler.cpp @@ -5,7 +5,7 @@ TSharedPtr FGESHandler::PrivateDefaultHandler = MakeShareable(new F bool FGESHandler::FirstParamIsCppType(UFunction* Function, const FString& TypeString) { - TArray Properties; + TArray Properties; FunctionParameters(Function, Properties); if (Properties.Num() == 0) { @@ -16,9 +16,9 @@ bool FGESHandler::FirstParamIsCppType(UFunction* Function, const FString& TypeSt return (FirstParam == TypeString); } -bool FGESHandler::FirstParamIsSubclassOf(UFunction* Function, UClass* ClassType) +bool FGESHandler::FirstParamIsSubclassOf(UFunction* Function, FFieldClass* ClassType) { - TArray Properties; + TArray Properties; FunctionParameters(Function, Properties); if (Properties.Num() == 0) { @@ -42,19 +42,19 @@ FString FGESHandler::EmitEventLogString(const FGESEmitData& EmitData) return EmitData.Domain + TEXT(".") + EmitData.Event; } -void FGESHandler::FunctionParameters(UFunction* Function, TArray& OutParamProperties) +void FGESHandler::FunctionParameters(UFunction* Function, TArray& OutParamProperties) { - TFieldIterator Iterator(Function); + TFieldIterator Iterator(Function); while (Iterator && (Iterator->PropertyFlags & CPF_Parm)) { - UProperty* Prop = *Iterator; + FProperty* Prop = *Iterator; OutParamProperties.Add(Prop); ++Iterator; } } -bool FGESHandler::FunctionHasValidParams(UFunction* Function, UClass* ClassType, const FGESEmitData& EmitData, const FGESEventListener& Listener) +bool FGESHandler::FunctionHasValidParams(UFunction* Function, FFieldClass* ClassType, const FGESEmitData& EmitData, const FGESEventListener& Listener) { if (FirstParamIsSubclassOf(Function, ClassType)) { @@ -110,7 +110,7 @@ void FGESHandler::UnpinEvent(const FString& Domain, const FString& EventName) { FGESEvent& Event = EventMap[KeyString]; Event.bPinned = false; - Event.PinnedData.Property->RemoveFromRoot(); + //Event.PinnedData.Property->RemoveFromRoot(); //Event.PinnedData.PropertyData.Empty(); not sure if safe to delete instead of rebuilding on next pin } } @@ -325,15 +325,15 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, UStruct* Struct, void* bool bValidateStructs = Options.bValidateStructTypes; EmitToListenersWithData(EmitData, [&EmitData, Struct, StructPtr, bValidateStructs](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UStructProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FStructProperty::StaticClass(), EmitData, Listener)) { if (bValidateStructs) { //For structs we can have different mismatching structs at this point check class types //optimization note: unroll the above function for structs to avoid double param lookup - TArray Properties; + TArray Properties; FunctionParameters(Listener.Function, Properties); - UStructProperty* StructProperty = Cast(Properties[0]); + FStructProperty* StructProperty = CastField(Properties[0]); if (StructProperty->Struct == Struct) { Listener.Receiver->ProcessEvent(Listener.Function, StructPtr); @@ -360,7 +360,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, const FString& ParamDa FString MutableParamString = ParamData; EmitToListenersWithData(EmitData, [&EmitData, &MutableParamString](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UStrProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FStrProperty::StaticClass(), EmitData, Listener)) { Listener.Receiver->ProcessEvent(Listener.Function, &MutableParamString); } @@ -371,7 +371,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, UObject* ParamData) { EmitToListenersWithData(EmitData, [&EmitData, ParamData](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UObjectProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FObjectProperty::StaticClass(), EmitData, Listener)) { FGESDynamicArg ParamWrapper; ParamWrapper.Arg01 = ParamData; @@ -384,7 +384,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, float ParamData) { EmitToListenersWithData(EmitData, [&EmitData, &ParamData](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UNumericProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FNumericProperty::StaticClass(), EmitData, Listener)) { Listener.Receiver->ProcessEvent(Listener.Function, &ParamData); } @@ -395,7 +395,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, int32 ParamData) { EmitToListenersWithData(EmitData, [&EmitData, &ParamData](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UNumericProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FNumericProperty::StaticClass(), EmitData, Listener)) { Listener.Receiver->ProcessEvent(Listener.Function, &ParamData); } @@ -406,7 +406,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, bool ParamData) { EmitToListenersWithData(EmitData, [&EmitData, &ParamData](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UBoolProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FBoolProperty::StaticClass(), EmitData, Listener)) { Listener.Receiver->ProcessEvent(Listener.Function, &ParamData); } @@ -418,7 +418,7 @@ void FGESHandler::EmitEvent(const FGESEmitData& EmitData, const FName& ParamData FName MutableName = ParamData; EmitToListenersWithData(EmitData, [&EmitData, &ParamData, &MutableName](const FGESEventListener& Listener) { - if (FunctionHasValidParams(Listener.Function, UNameProperty::StaticClass(), EmitData, Listener)) + if (FunctionHasValidParams(Listener.Function, FNameProperty::StaticClass(), EmitData, Listener)) { Listener.Receiver->ProcessEvent(Listener.Function, &MutableName); } @@ -437,7 +437,7 @@ bool FGESHandler::EmitEvent(const FGESEmitData& EmitData) } return false; } - UProperty* ParameterProp = EmitData.Property; + FProperty* ParameterProp = EmitData.Property; void* PropPtr = EmitData.PropertyPtr; //no params specified @@ -454,12 +454,12 @@ bool FGESHandler::EmitEvent(const FGESEmitData& EmitData) Listener.OnePropertyFunctionDelegate.ExecuteIfBound(Wrapper); return; } - TFieldIterator Iterator(Listener.Function); + TFieldIterator Iterator(Listener.Function); - TArray Properties; + TArray Properties; while (Iterator && (Iterator->PropertyFlags & CPF_Parm)) { - UProperty* Prop = *Iterator; + FProperty* Prop = *Iterator; Properties.Add(Prop); ++Iterator; } @@ -475,29 +475,29 @@ bool FGESHandler::EmitEvent(const FGESEmitData& EmitData) } }); } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UStructProperty* StructProperty = ExactCast(ParameterProp); + FStructProperty* StructProperty = CastField(ParameterProp); EmitEvent(EmitData, StructProperty->Struct, PropPtr); return true; } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UStrProperty* StrProperty = Cast(ParameterProp); + FStrProperty* StrProperty = CastField(ParameterProp); FString Data = StrProperty->GetPropertyValue(PropPtr); EmitEvent(EmitData, Data); return true; } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UObjectProperty* ObjectProperty = Cast(ParameterProp); + FObjectProperty* ObjectProperty = CastField(ParameterProp); UObject* Data = ObjectProperty->GetPropertyValue(PropPtr); EmitEvent(EmitData, Data); return true; } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UNumericProperty* NumericProperty = Cast(ParameterProp); + FNumericProperty* NumericProperty = CastField(ParameterProp); if (NumericProperty->IsFloatingPoint()) { double Data = NumericProperty->GetFloatingPointPropertyValue(PropPtr); @@ -511,16 +511,16 @@ bool FGESHandler::EmitEvent(const FGESEmitData& EmitData) return true; } } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UBoolProperty* BoolProperty = Cast(ParameterProp); + FBoolProperty* BoolProperty = CastField(ParameterProp); bool Data = BoolProperty->GetPropertyValue(PropPtr); EmitEvent(EmitData, Data); return true; } - else if (ParameterProp->IsA()) + else if (ParameterProp->IsA()) { - UNameProperty* NameProperty = Cast(ParameterProp); + FNameProperty* NameProperty = CastField(ParameterProp); FName Data = NameProperty->GetPropertyValue(PropPtr); EmitEvent(EmitData, Data); return true; diff --git a/Source/GlobalEventSystem/Private/GESHandler.h b/Source/GlobalEventSystem/Private/GESHandler.h index 5fe4a40..1455ab0 100644 --- a/Source/GlobalEventSystem/Private/GESHandler.h +++ b/Source/GlobalEventSystem/Private/GESHandler.h @@ -76,14 +76,14 @@ class FGESHandler //can check function signature vs e.g. FString static bool FirstParamIsCppType(UFunction* Function, const FString& TypeString); - static bool FirstParamIsSubclassOf(UFunction* Function, UClass* ClassType); + static bool FirstParamIsSubclassOf(UFunction* Function, FFieldClass* ClassType); static FString ListenerLogString(const FGESEventListener& Listener); static FString EventLogString(const FGESEvent& Event); static FString EmitEventLogString(const FGESEmitData& EmitData); - static void FunctionParameters(UFunction* Function, TArray& OutParamProperties); + static void FunctionParameters(UFunction* Function, TArray& OutParamProperties); //this function logs warnings otherwise - static bool FunctionHasValidParams(UFunction* Function, UClass* ClassType, const FGESEmitData& EmitData, const FGESEventListener& Listener); + static bool FunctionHasValidParams(UFunction* Function, FFieldClass* ClassType, const FGESEmitData& EmitData, const FGESEventListener& Listener); //Key == TargetDomain.TargetFunction TMap EventMap; diff --git a/Source/GlobalEventSystem/Private/GlobalEventSystemBPLibrary.cpp b/Source/GlobalEventSystem/Private/GlobalEventSystemBPLibrary.cpp index bc049df..9822666 100644 --- a/Source/GlobalEventSystem/Private/GlobalEventSystemBPLibrary.cpp +++ b/Source/GlobalEventSystem/Private/GlobalEventSystemBPLibrary.cpp @@ -47,7 +47,7 @@ void UGlobalEventSystemBPLibrary::HandleEmit(const FGESEmitData& EmitData) FGESHandler::DefaultHandler()->EmitEvent(EmitData); } -void UGlobalEventSystemBPLibrary::GESEmitEventOneParam(UObject* WorldContextObject, bool bPinned /*= false*/, const FString& Domain /*= TEXT("global.default")*/, const FString& Event /*= TEXT("")*/, UProperty* ParameterData /*= nullptr*/) +void UGlobalEventSystemBPLibrary::GESEmitEventOneParam(UObject* WorldContextObject, TFieldPath ParameterData, bool bPinned /*= false*/, const FString& Domain /*= TEXT("global.default")*/, const FString& Event /*= TEXT("")*/) { //this never gets called due to custom thunk } @@ -74,9 +74,9 @@ void UGlobalEventSystemBPLibrary::SetGESOptions(const FGESGlobalOptions& InOptio bool UGlobalEventSystemBPLibrary::Conv_PropToInt(const FGESWildcardProperty& InProp, int32& OutInt) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UNumericProperty* Property = Cast(InProp.Property); + FNumericProperty* Property = CastField(InProp.Property.Get()); if (Property->IsFloatingPoint()) { OutInt = Property->GetSignedIntPropertyValue(InProp.PropertyPtr); @@ -98,9 +98,9 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToInt(const FGESWildcardProperty& InP bool UGlobalEventSystemBPLibrary::Conv_PropToFloat(const FGESWildcardProperty& InProp, float& OutFloat) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UNumericProperty* Property = Cast(InProp.Property); + FNumericProperty* Property = CastField(InProp.Property.Get()); if (Property->IsFloatingPoint()) { OutFloat = Property->GetFloatingPointPropertyValue(InProp.PropertyPtr); @@ -122,9 +122,9 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToFloat(const FGESWildcardProperty& I bool UGlobalEventSystemBPLibrary::Conv_PropToBool(const FGESWildcardProperty& InProp, bool& OutBool) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UBoolProperty* Property = Cast(InProp.Property); + FBoolProperty* Property = CastField(InProp.Property.Get()); OutBool = Property->GetPropertyValue(InProp.PropertyPtr); return true; } @@ -137,9 +137,9 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToBool(const FGESWildcardProperty& In bool UGlobalEventSystemBPLibrary::Conv_PropToStringRef(const FGESWildcardProperty& InProp, FString& OutString) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UStrProperty* Property = Cast(InProp.Property); + FStrProperty* Property = CastField(InProp.Property.Get()); OutString = Property->GetPropertyValue(InProp.PropertyPtr); return true; } @@ -148,9 +148,9 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToStringRef(const FGESWildcardPropert UE_LOG(LogTemp, Warning, TEXT("UGlobalEventSystemBPLibrary::Conv_PropToString %s is not an FString, attempted best conversion for display purposes."), *InProp.Property->GetName()); //Convert logic - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UNumericProperty* Property = Cast(InProp.Property); + FNumericProperty* Property = CastField(InProp.Property.Get()); if (Property->IsFloatingPoint()) { OutString = FString::SanitizeFloat(Property->GetFloatingPointPropertyValue(InProp.PropertyPtr)); @@ -160,9 +160,9 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToStringRef(const FGESWildcardPropert OutString = FString::FromInt(Property->GetSignedIntPropertyValue(InProp.PropertyPtr)); } } - else if (InProp.Property->IsA()) + else if (InProp.Property->IsA()) { - UBoolProperty* Property = Cast(InProp.Property); + FBoolProperty* Property = CastField(InProp.Property.Get()); if (Property->GetPropertyValue(InProp.PropertyPtr)) { OutString = TEXT("True"); @@ -172,20 +172,20 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToStringRef(const FGESWildcardPropert OutString = TEXT("False"); } } - else if (InProp.Property->IsA()) + else if (InProp.Property->IsA()) { - UNameProperty* Property = Cast(InProp.Property); + FNameProperty* Property = CastField (InProp.Property.Get()); OutString = Property->GetPropertyValue(InProp.PropertyPtr).ToString(); } - else if (InProp.Property->IsA()) + else if (InProp.Property->IsA()) { - UObjectProperty* Property = Cast(InProp.Property); + FObjectProperty* Property = CastField(InProp.Property.Get()); UObject* Object = Property->GetPropertyValue(InProp.PropertyPtr); OutString = Object->GetName() + TEXT(", type: ") + Object->GetClass()->GetName(); } - else if (InProp.Property->IsA()) + else if (InProp.Property->IsA()) { - UStructProperty* Property = Cast(InProp.Property); + FStructProperty* Property = CastField(InProp.Property.Get()); OutString = Property->GetName() + TEXT(", type: ") + Property->Struct->GetName(); } return false; @@ -201,9 +201,9 @@ FString UGlobalEventSystemBPLibrary::Conv_PropToString(const FGESWildcardPropert bool UGlobalEventSystemBPLibrary::Conv_PropToName(const FGESWildcardProperty& InProp, FName& OutName) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UNameProperty* Property = Cast(InProp.Property); + FNameProperty* Property = CastField(InProp.Property.Get()); OutName = Property->GetPropertyValue(InProp.PropertyPtr); return true; } @@ -214,7 +214,7 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToName(const FGESWildcardProperty& In } } -bool UGlobalEventSystemBPLibrary::Conv_PropToStruct(const FGESWildcardProperty& InProp, UProperty*& OutStruct) +bool UGlobalEventSystemBPLibrary::Conv_PropToStruct(const FGESWildcardProperty& InProp, TFieldPath& OutStruct) { //doesn't get called due to custom thunk return false; @@ -222,10 +222,10 @@ bool UGlobalEventSystemBPLibrary::Conv_PropToStruct(const FGESWildcardProperty& bool UGlobalEventSystemBPLibrary::HandlePropToStruct(const FGESWildcardProperty& InProp, FGESWildcardProperty& OutProp) { - if (InProp.Property->IsA() && OutProp.Property->IsA()) + if (InProp.Property->IsA() && OutProp.Property->IsA()) { - UStructProperty* InStructProp = Cast(InProp.Property); - UStructProperty* OutStructProp = Cast(OutProp.Property); + FStructProperty* InStructProp = CastField(InProp.Property.Get()); + FStructProperty* OutStructProp = CastField(OutProp.Property.Get()); OutStructProp->CopyCompleteValue(OutProp.PropertyPtr, InProp.PropertyPtr); return true; @@ -238,9 +238,9 @@ bool UGlobalEventSystemBPLibrary::HandlePropToStruct(const FGESWildcardProperty& bool UGlobalEventSystemBPLibrary::Conv_PropToObject(const FGESWildcardProperty& InProp, UObject*& OutObject) { - if (InProp.Property->IsA()) + if (InProp.Property->IsA()) { - UObjectProperty* Property = Cast(InProp.Property); + FObjectProperty* Property = CastField(InProp.Property.Get()); OutObject = Property->GetPropertyValue(InProp.PropertyPtr); return true; } diff --git a/Source/GlobalEventSystem/Public/GESDataTypes.h b/Source/GlobalEventSystem/Public/GESDataTypes.h index 1bb923b..ea7cbdb 100644 --- a/Source/GlobalEventSystem/Public/GESDataTypes.h +++ b/Source/GlobalEventSystem/Public/GESDataTypes.h @@ -29,7 +29,7 @@ struct FGESWildcardProperty GENERATED_USTRUCT_BODY() UPROPERTY(BlueprintReadOnly, Category = "GES Global Options") - UProperty* Property; + TFieldPath Property; void* PropertyPtr; @@ -75,7 +75,7 @@ struct FGESEventListener struct FGESPinnedData { - UProperty* Property; + FProperty* Property; void* PropertyPtr; TArray PropertyData; @@ -115,7 +115,7 @@ struct FGESEmitData bool bPinned; FString Domain; FString Event; - UProperty* Property; + FProperty* Property; void* PropertyPtr; UObject* WorldContext; diff --git a/Source/GlobalEventSystem/Public/GlobalEventSystemBPLibrary.h b/Source/GlobalEventSystem/Public/GlobalEventSystemBPLibrary.h index d186b92..8f22562 100644 --- a/Source/GlobalEventSystem/Public/GlobalEventSystemBPLibrary.h +++ b/Source/GlobalEventSystem/Public/GlobalEventSystemBPLibrary.h @@ -38,7 +38,7 @@ class UGlobalEventSystemBPLibrary : public UBlueprintFunctionLibrary * emitted. */ UFUNCTION(BlueprintCallable, CustomThunk, Category = "GlobalEventSystem", meta = (CustomStructureParam = "ParameterData", WorldContext = "WorldContextObject")) - static void GESEmitEventOneParam(UObject* WorldContextObject, bool bPinned = false, const FString& Domain = TEXT("global.default"), const FString& Event = TEXT(""), UProperty* ParameterData = nullptr); + static void GESEmitEventOneParam(UObject* WorldContextObject, TFieldPath ParameterData, bool bPinned = false, const FString& Domain = TEXT("global.default"), const FString& Event = TEXT("")); /** * Just emits the event with no additional data @@ -81,7 +81,7 @@ class UGlobalEventSystemBPLibrary : public UBlueprintFunctionLibrary static bool Conv_PropToName(const FGESWildcardProperty& InProp, FName& OutName); UFUNCTION(BlueprintPure, CustomThunk, meta = (DisplayName = "To Struct (Wildcard Property)", CustomStructureParam = "OutStruct", BlueprintAutocast), Category = "Utilities|SocketIO") - static bool Conv_PropToStruct(const FGESWildcardProperty& InProp, UProperty*& OutStruct); + static bool Conv_PropToStruct(const FGESWildcardProperty& InProp, TFieldPath& OutStruct); UFUNCTION(BlueprintPure, meta = (DisplayName = "To Object (Wildcard Property)", BlueprintAutocast), Category = "Utilities|SocketIO") static bool Conv_PropToObject(const FGESWildcardProperty& InProp, UObject*& OutObject); @@ -92,19 +92,20 @@ class UGlobalEventSystemBPLibrary : public UBlueprintFunctionLibrary Stack.MostRecentProperty = nullptr; FGESEmitData EmitData; - Stack.StepCompiledIn(&EmitData.WorldContext); - Stack.StepCompiledIn(&EmitData.bPinned); - Stack.StepCompiledIn(&EmitData.Domain); - Stack.StepCompiledIn(&EmitData.Event); + Stack.StepCompiledIn(&EmitData.WorldContext); //Determine wildcard property Stack.Step(Stack.Object, NULL); - UProperty* ParameterProp = Cast(Stack.MostRecentProperty); + FProperty* ParameterProp = CastField(Stack.MostRecentProperty); void* PropPtr = Stack.MostRecentPropertyAddress; EmitData.Property = ParameterProp; EmitData.PropertyPtr = PropPtr; + Stack.StepCompiledIn(&EmitData.bPinned); + Stack.StepCompiledIn(&EmitData.Domain); + Stack.StepCompiledIn(&EmitData.Event); + P_FINISH; P_NATIVE_BEGIN; HandleEmit(EmitData); @@ -118,11 +119,11 @@ class UGlobalEventSystemBPLibrary : public UBlueprintFunctionLibrary FGESWildcardProperty OutProp; //Determine copy wildcard property variables - Stack.StepCompiledIn(&InProp); + Stack.StepCompiledIn(&InProp); //Copy the out struct property address Stack.Step(Stack.Object, NULL); - UProperty* ParameterProp = Cast(Stack.MostRecentProperty); + FProperty* ParameterProp = CastField(Stack.MostRecentProperty); void* PropPtr = Stack.MostRecentPropertyAddress; OutProp.Property = ParameterProp;