pi = FindItemBySerial(vecContainer[ci]);
void backpack2(int s, int a1, int a2, int a3, int a4) // 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";	int serial=calcserial(a1,a2,a3,a4);	int ci=0,loopexit=0;	P_ITEM pi;	while ( ((pi=ContainerSearch(serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )	{		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;	display1[3]=a1;	display1[4]=a2;	display1[5]=a3;	display1[6]=a4;	Xsend(s, display1, 7);	ci=0;	loopexit=0;	while ( ((pi=ContainerSearch(serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )	{		if (pi->layer!=0)		{			display2[0]=pi->layer;			display2[1]=pi->ser1;			display2[2]=pi->ser2;			display2[3]=pi->ser3;			display2[4]=pi->ser4;			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);	ci=0;	loopexit=0;	while ( ((pi=ContainerSearch(serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )	{		if (pi->layer!=0)		{			bpitem[0]=pi->ser1;			bpitem[1]=pi->ser2;			bpitem[2]=pi->ser3;			bpitem[3]=pi->ser4;			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;			bpitem[13]=a1;			bpitem[14]=a2;			bpitem[15]=a3;			bpitem[16]=a4;			bpitem[17]=pi->color1;			bpitem[18]=pi->color2;			bpitem[19]=pi->decaytime=0;// reseting the decaytimer in the backpack	//moroallan			Xsend(s, bpitem, 19);		}	}}