Code:
void AddItem(int A)
{
int B;
amount += A;
if( amount < stackSize )
{
B = amount - stackSize;
GetItem(B)
}
}
void GetItem(int A)
{
for( int iii=0; iii != MAX_INV; iii++)
if( charInv[iii].id == 0 )
{
charInv[iii] = *this;
charInv[iii].additem(A);
break;
}
else if( charInv[iii].id == id)
if( charInv[iii].amount < stackSize)
{
charInv[iii].AddItem(A);
break;
}
}
does this code make any sense?
what i tried to do here is when u get item the prog' look for empty slots if it finds one it copies the item into the empty slot if it find a slot with the same item and the and there's still stacksize left it adds the item amount to the item (uses different prog') if the amount passe the stacksize then it reads by how much it passed it and then subscribes it from the amount and then calls the GetItem prog' to put it in new slot, it won't put it on the same slot because of the condition statement