Getting an Asset Reference

Ah, I see. Thank you.

The system I’m trying to create is one where I store information (Such as DataTables holding Item Data) in some custom project settings. Item objects then pull the info from there, using FObjectFinder (although the ref paths are now saved in a Config file).

Faced with best practices in memory management, would a system like this be worth pursuing? Should I have the Item Info DataTable as a variable in the Item Object?

What is currently in my Item Object Constructor:

	FString MasterItemListRef;
	bool MatchFound = false;

	//Get Config File and reference to DataTable
	FString File = FPaths::GeneratedConfigDir().Append("Game.ini");
	GConfig->GetString(TEXT("/Script/MIS.MISGlobalSettings"), TEXT("MasterItemList"), MasterItemListRef, GGameIni);
	
	//Get DataTable Object
	static ConstructorHelpers::FObjectFinder<UDataTable> ItemRef(*MasterItemListRef);
	UDataTable* MasterItemList = ItemRef.Object;
	
	//Is DT valid?
	if (MasterItemList)
	{

		//Querry Row Name to see if ItemID matches
		for (FName QuerriedID : MasterItemList->GetRowNames())
		{
			if (ItemID == QuerriedID)
			{
				BaseItemProperties = *MasterItemList->FindRow<FMISItemInfo>(ItemID, "");
				MatchFound = true;
				break;
			}
		}
	}

	//Is Item Properties valid?
	if (!MatchFound)
	{
		UE_LOG(LogTemp, Error, TEXT("Error: %s is not a valid ItemID"), *this->GetFName().ToString());
	}