count2=(count*5)+7 + 1 ;
count2 = (vecContainerPtr.size() * 5) + 7 + 1 ;
void backpack2(int s, SERIAL serial) // Send corpse stuff{	int count=0, count2;	unsigned char bpopen2[6]="\x3C\x00\x05\x00\x00";	unsigned char display1[8]="\x89\x00\x0D\x40\x01\x02\x03";	unsigned char display2[6]="\x01\x40\x01\x02\x03";	//SERIAL serial = calcserial(a1,a2,a3,a4);	register unsigned int ci;	P_ITEM pi;	vector<SERIAL> vecContainer = contsp.getData(serial);	for ( ci = 0; ci < vecContainer.size(); ++ci)	{		pi = FindItemBySerial(vecContainer[ci]);		if (pi->layer!=0)		{			++count;		}	}	count2=(count*5)+7 + 1 ; // 5 bytes per object, 7 for this header and 1 for terminator	display1[1]=count2>>8;	display1[2]=count2%256;	LongToCharPtr(serial, &display1[3]);	Xsend(s, display1, 7);	for ( ci = 0; ci < vecContainer.size(); ++ci)	{		pi = FindItemBySerial(vecContainer[ci]);		if (pi->layer!=0)		{			display2[0]=pi->layer;			LongToCharPtr(pi->serial, &display2[1]);			Xsend(s, display2, 5);		}	}	char nul = 0;	Xsend(s, &nul, 1);	// Terminate with a 0	bpopen2[3]=count>>8;	bpopen2[4]=count%256;	count2=(count*19)+5;	bpopen2[1]=count2>>8;	bpopen2[2]=count2%256;	Xsend(s, bpopen2, 5);	for ( ci = 0; ci < vecContainer.size(); ++ci)	{		pi = FindItemBySerial(vecContainer[ci]);		if (pi->layer!=0)		{			LongToCharPtr(pi->serial, &bpitem[0]);			ShortToCharPtr(pi->id(),bpitem+4);			bpitem[7]=pi->amount>>8;			bpitem[8]=pi->amount%256;			bpitem[9]=pi->pos.x>>8;			bpitem[10]=pi->pos.x%256;			bpitem[11]=pi->pos.y>>8;			bpitem[12]=pi->pos.y%256;			LongToCharPtr(serial, &bpitem[13]);			ShortToCharPtr(pi->color, &bpitem[17]);			bpitem[19]=pi->decaytime=0;// reseting the decaytimer in the backpack	//moroallan			Xsend(s, bpitem, 19);		}	}}