Ive been using Monkey's script for a while, but I was wondering if this is "as good"? What do you think guys? Can this help joseph?
Code: ags
I tested it out on my game and it seems to work...is this valid too?
void SwapInventory(this Character*, Character *otherCharacter)
{
if (otherCharacter == null) return;
int iItemCount = invInventory.ItemCount;
int i = 0;
while (i < iItemCount)
{
InventoryItem* iItemName = invInventory.ItemAtIndex[i];
if (!otherCharacter.HasInventory(iItemName)) otherCharacter.AddInventory(iItemName);
i++;
}
}
I tested it out on my game and it seems to work...is this valid too?