I’m still convinced it has to do with declaring FName with the same constructor in the same scope.
Could you try to modify your implementation to be this?
I’m assuming that the type of AmmoElemArray is a string? If it is you should convert them to const TChar array with * operator like I show below.
case EItemType::E_Ammo:
{
if (const UDataTable* ItemAmmoRowNames = LoadObject<UDataTable>(GetWorld(), TEXT("/Game/DataTables/Items/Ammo/DT_ItemAmmo")))
{
for (auto& AmmoElemArray : ItemAmmoRowNames->GetRowNames())
{
if (const UDataTable* ItemAmmoFindRow{ LoadObject<UDataTable>(GetWorld(), TEXT("/Game/DataTables/Items/Ammo/DT_ItemAmmo")) })
{
if (const FST_ItemAmmo * OutRow_Ammo{ ItemAmmoFindRow->FindRow<FST_ItemAmmo>(*AmmoElemArray, "") })
{
if (OutRow_Ammo)
{
for (int32 i = 1; i <= OutRow_Ammo->ProbabilityPercent; i++)
{
TempTypeAndID_Setter.Type = EItemType::E_Ammo;
TempTypeAndID_Setter.ID = *AmmoElemArray;
Arr.Add(TempTypeAndID_Setter);//Adding elements
}
}
}
}
}
}
}break;