else if ( !strcmpi(subcmd, "set") ) // to record our restock settings
{
for (j=0; j < MAX_INVENTORY; ++j)
{
if (!sd->inventory_data[j])
continue;
switch (sd->inventory_data[j]->type)
{
case IT_HEALING:
case IT_USABLE:
case IT_ETC:
case IT_DELAYCONSUME:
case IT_THROWWEAPON:
case IT_CASH:
case IT_AMMO:
{
if ( !itemdb_canstore(&sd->restock[idx].items[i], pc_isGM(sd)) )
continue;
if( sd->restock[idx].items[i].card[0] == CARD0_CREATE )
{
int char_id = MakeDWord(sd->restock[idx].items[i].card[2],sd->restock[idx].items[i].card[3]);
if( (BG_CHARID && char_id == BG_CHARID && BG_TRADE&32) || (WOE_CHARID && char_id == WOE_CHARID && WOE_TRADE&32) || (RAID_CHARID && char_id == RAID_CHARID && RAID_TRADE&32) )
{
continue;
}
}
memcpy(&sd->restock[idx].items[i], &sd->status.inventory[j], sizeof (struct item));
++i;
}
default:
continue;
}
if (i >= MAX_RESTOCK_ITEMS)
break;
}
sd->restock[idx].size = i;
if (sd->restock[idx].size > MAX_RESTOCK_ITEMS) // how would this happen? well, don't know don't care it shouldn't be this value!
sd->restock[idx].size = MAX_RESTOCK_ITEMS;
sd->state.restock_dirty |= (1<<idx);
ShowDebug("Restock Slot %d marked for saving. (Dirty: %d)\n", idx, sd->state.restock_dirty);
strcpy(subcmd, "check"); // so players will immediately view what they have set :)
}