int i; int serial,serhash,ci;
int serial,ci;
void dotrade(P_ITEM cont1, P_ITEM cont2){	int i;	int serial,serhash,ci;	P_CHAR p1 = FindCharBySerial(cont1->contserial);	if(p1 == NULL) return;	P_CHAR p2 = FindCharBySerial(cont2->contserial);	if(p2 == NULL) return;	if(cont1->morez==0 || cont2->morez==0)	{//not checked - give items to previous owners - AntiChrist		P_CHAR t;		t  = p1;		p1 = p2;		p2 = t;	}	P_ITEM bp1 = Packitem(p1);	if(bp1 == NULL) return;	P_ITEM bp2 = Packitem(p2);	if(bp2 == NULL) return;	UOXSOCKET s1 = calcSocketFromChar(p1);	UOXSOCKET s2 = calcSocketFromChar(p2);	serial = cont1->serial;	vector<SERIAL> vecContainer = contsp.getData(serial);	for (ci = 0; ci < vecContainer.size(); ci++)	{		P_ITEM pi = FindItemBySerial(vecContainer[ci]);		if (pi != NULL)			if ((pi->contserial==serial))			{				if (pi->glow != INVALID_SERIAL) 					glowsp.remove(p2->serial, pi->serial); // lb, glowing stuff				bp2->AddItem(pi);				if (pi->glow != INVALID_SERIAL) 					glowsp.insert(p1->serial, pi->serial);				if (s1!=-1)					RefreshItem(pi);//AntiChrist				if (s2!=-1) sendbpitem(s2, pi);					RefreshItem(pi);//AntiChrist			}	}	serial = cont2->serial;	vecContainer.clear();	vecContainer = contsp.getData(serial);	for (ci=0;ci<vecContainer.size();ci++)	{		P_ITEM pi = FindItemBySerial(vecContainer[ci]);		if (pi != NULL)			if ((pi->contserial==serial))			{				if (pi->glow != INVALID_SERIAL) 					glowsp.remove(p2->serial, pi->serial); // lb, glowing stuff				bp1->AddItem(pi);				if (pi->glow != INVALID_SERIAL) 					glowsp.insert(chars[currchar[s1]].serial, pi->serial);				if (s2 != INVALID_UOXSOCKET)					RefreshItem(pi);//AntiChrist				if (s1 != INVALID_UOXSOCKET) sendbpitem(s1, pi);					RefreshItem(pi);//AntiChrist			}	}}