Details:
I have an array of strings. Let's say 100 strings (Inventory classes).
Code: Select all
foreach(cls : items)
{
Inventory item = Inventory(Actor.Spawn(cls));
if(!item)
{
Console.printf("\cgInvalid item, not adding to inventory : "..cls);
continue;
}
if(!item.CallTryPickup(Owner))
{
Console.printf("\cgFailed to add item to inventory : "..item.GetClassName());
item.Destroy();
}
}
Code: Select all
Inv = item;