Fix for UE-90683: You can no longer delete conflicting variables

Refactored FindField into FindUField and FindFProperty to avoid confusion caused by the fact that FindField<UField> will no longer return FProperties.

#jira UE-90683
#rb Steve.Robb
#tests Basic editor functionality test, cooked and ran PC client and server, bot soak tests for two hours

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 12190998 in //UE4/Release-4.25/... via CL 12190999
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v661-12148976)

[CL 12191300 by robert manuszewski in Main branch]
This commit is contained in:
robert manuszewski
2020-03-15 10:33:45 -04:00
parent 6e603b4889
commit b7568cc694
172 changed files with 547 additions and 473 deletions

View File

@@ -210,7 +210,7 @@ bool ANUTActor::NotifyControlMessage(UNetConnection* Connection, uint8 MessageTy
{
// Assign LocalPlayerOwner property, to the PC owning this NUTActor, using reflection (to avoid dependency)
FObjectProperty* LocalPlayerOwnerProp =
FindField<FObjectProperty>(NewActor->GetClass(), TEXT("LocalPlayerOwner"));
FindFProperty<FObjectProperty>(NewActor->GetClass(), TEXT("LocalPlayerOwner"));
if (LocalPlayerOwnerProp != NULL)
{
@@ -694,7 +694,7 @@ void ANUTActor::ExecuteOnServer(UObject* InTargetObj, FString InTargetFunc)
// and then send it to the server
TempDelegate.BindUFunction(TargetObjCDO, TargetFuncName);
FDelegateProperty* DelProp = FindField<FDelegateProperty>(GetClass(), TEXT("TempDelegate"));
FDelegateProperty* DelProp = FindFProperty<FDelegateProperty>(GetClass(), TEXT("TempDelegate"));
FString DelString;
DelProp->ExportTextItem(DelString, DelProp->ContainerPtrToValuePtr<uint8>(this), nullptr, this, 0, nullptr);
@@ -730,7 +730,7 @@ bool ANUTActor::ServerExecute_Validate(const FString& InDelegate)
void ANUTActor::ServerExecute_Implementation(const FString& InDelegate)
{
// Convert the string back into a delegate, and execute
FDelegateProperty* DelProp = FindField<FDelegateProperty>(GetClass(), TEXT("TempDelegate"));
FDelegateProperty* DelProp = FindFProperty<FDelegateProperty>(GetClass(), TEXT("TempDelegate"));
const TCHAR* InDelText = *InDelegate;

View File

@@ -135,7 +135,7 @@ FVMReflection& FVMReflection::operator ->*(FString PropertyName)
if (FieldInstance.IsA(UClass::StaticClass()))
{
const UClass* ClassInstance = Cast<UClass>(FieldInstance.ToUObject());
FProperty* FoundProperty = FindField<FProperty>(ClassInstance, *PropertyName);
FProperty* FoundProperty = FindFProperty<FProperty>(ClassInstance, *PropertyName);
if (FoundProperty != nullptr)
{
@@ -156,7 +156,7 @@ FVMReflection& FVMReflection::operator ->*(FString PropertyName)
if (!IsPropertyArray() || (bVerifiedFieldType && bSetArrayElement))
{
const UStruct* InnerStruct = Cast<UStruct>(FieldInstance.ToUObject());
FProperty* FoundProperty = (InnerStruct != nullptr ? FindField<FProperty>(InnerStruct, *PropertyName) : nullptr);
FProperty* FoundProperty = (InnerStruct != nullptr ? FindFProperty<FProperty>(InnerStruct, *PropertyName) : nullptr);
if (FoundProperty != nullptr)
{

View File

@@ -77,18 +77,18 @@ class FFuncReflection;
*
* Old code (manual reflection):
* // Reflection for AFortPlayerController->QuickBars
* FObjectProperty* QuickBarsProp = FindField<FObjectProperty>(UnitPC->GetClass(), TEXT("QuickBars"));
* FObjectProperty* QuickBarsProp = FindFProperty<FObjectProperty>(UnitPC->GetClass(), TEXT("QuickBars"));
* UObject** QuickBarsRef = (QuickBarsProp != NULL ? QuickBarsProp->ContainerPtrToValuePtr<UObject*>(UnitPC.Get()) : NULL);
* AActor* QuickBars = (QuickBarsRef != NULL ? Cast<AActor>(*QuickBarsRef) : NULL);
*
*
* // Reflection for AFortPlayerController->WorldInventory->Inventory->Items->ItemGuid
* FObjectProperty* WorldInvProp = FindField<FObjectProperty>(UnitPC->GetClass(), TEXT("WorldInventory"));
* FObjectProperty* WorldInvProp = FindFProperty<FObjectProperty>(UnitPC->GetClass(), TEXT("WorldInventory"));
* UObject** WorldInvRef = (WorldInvProp != NULL ? WorldInvProp->ContainerPtrToValuePtr<UObject*>(UnitPC.Get()) : NULL);
* AActor* WorldInv = (WorldInvRef != NULL ? Cast<AActor>(*WorldInvRef) : NULL);
* FStructProperty* WIInventoryProp = (WorldInv != NULL ? FindField<FStructProperty>(WorldInv->GetClass(), TEXT("Inventory")) : NULL);
* FStructProperty* WIInventoryProp = (WorldInv != NULL ? FindFProperty<FStructProperty>(WorldInv->GetClass(), TEXT("Inventory")) : NULL);
* void* WIInventoryRef = (WIInventoryProp != NULL ? WIInventoryProp->ContainerPtrToValuePtr<void>(WorldInv) : NULL);
* FArrayProperty* InvItemsProp = (WIInventoryProp != NULL ? FindField<FArrayProperty>(WIInventoryProp->Struct, TEXT("Items")) : NULL);
* FArrayProperty* InvItemsProp = (WIInventoryProp != NULL ? FindFProperty<FArrayProperty>(WIInventoryProp->Struct, TEXT("Items")) : NULL);
* FScriptArrayHelper* InvItemsArray = ((InvItemsProp != NULL && WIInventoryRef != NULL) ?
* new FScriptArrayHelper(InvItemsProp, InvItemsProp->ContainerPtrToValuePtr<void>(WIInventoryRef)) : NULL);
*
@@ -96,7 +96,7 @@ class FFuncReflection;
* InvItemsArray->GetRawPtr(0) : NULL);
* FStructProperty* InvItemsEntryProp = CastField<FStructProperty>(InvItemsProp != NULL ? InvItemsProp->Inner : NULL);
* FStructProperty* EntryItemGuidProp = (InvItemsEntryProp != NULL ?
* FindField<FStructProperty>(InvItemsEntryProp->Struct, TEXT("ItemGuid")) : NULL);
* FindFProperty<FStructProperty>(InvItemsEntryProp->Struct, TEXT("ItemGuid")) : NULL);
* FGuid* EntryItemGuidRef = (EntryItemGuidProp != NULL ? InvItemsEntryProp->ContainerPtrToValuePtr<FGuid>(InvItemsEntryRef) : NULL);
*
* ...
@@ -868,7 +868,7 @@ public:
* @param InFuncName The name of the function
*/
FFuncReflection(const TCHAR* InClassName, const TCHAR* InFuncName)
: FFuncReflection(FindField<UFunction>(FindObject<UClass>(ANY_PACKAGE, InClassName), InFuncName), InFuncName)
: FFuncReflection(FindUField<UFunction>(FindObject<UClass>(ANY_PACKAGE, InClassName), InFuncName), InFuncName)
{
}