int serhash = serial%HASHMAX;
int DeleBankItem( CHARACTER p, unsigned short itemid, unsigned short color, int amt ){	if( p < 0 || p > cmem )		return amt;	unsigned char cid1 = (char)(color>>8);	unsigned char cid2 = (char)(color%256);	SERIAL serial = chars[p].serial;	int serhash = serial%HASHMAX;	int counter2 = 0;	int total = amt;	int ci;	vector<SERIAL> vecOwn = ownsp.getData(serial);	for( ci = 0; ci < vecOwn.size() && total > 0; ci++ )	{		P_ITEM pj = FindItemBySerial(vecOwn[ci]);		if( pj != NULL )		{			if( pj->ownserial == serial && pj->type == 1 && pj->morex == 1 )			{				vector<SERIAL> vecContainer = contsp.getData(pj->serial);				for( counter2 = 0; counter2 < vecContainer.size() && total > 0; counter2++ )				{					P_ITEM pi = FindItemBySerial(vecContainer[counter2]);					if( pi != NULL )					{						if( pi->contserial == pj->serial )						{							if( pi->id() == itemid )							{								if( pi->color1 == cid1 && pi->color2 == cid2 )								{									if( total >= pi->amount )									{										total -= pi->amount;										Items->DeleItem( pi );									}									else									{										pi->amount -= total;										total = 0;										RefreshItem( pi );									}								}							}						}					}				}			}		}	}	return total;}