-
::That’s strange. Do you notice that your slotNum
is returning -1? This means that this loop in your code is not running entirely (otherwise slotNum
will be any number other than -1):
for (int i = 0; i < weaponSlots.Capacity; i++)
{
if (weaponSlots[i].IsEmpty())
{
slotNum = i;
break;
}
}
The only way it does not run, is if your weaponSlots
variable has a capacity of 0. Can you try changing weaponSlots.Capacity
to weaponSlots.Count
instead and see if it fixes the issue?