for (ci=0;ci<contsp[pc->serial%HASHMAX].max;ci++)
vector<SERIAL> vecContainer = contsp.getData(pc->serial); for (ci = 0; ci < vecContainer.size(); ci++)
void impowncreate(int s, int i, int z) //socket, player to send{	int j, k,ci;	unsigned char oc[1024];	if ( (i < 0) || (i > cmem))	{#ifdef DEBUG		ConOut("impowncreate -> i overflow. (%i)", i);#endif		i = 0;	}    P_CHAR pc = MAKE_CHARREF_LR(i);	if (s==-1) return; //lb	P_CHAR pc_currchar = MAKE_CHARREF_LR(currchar[s]);	if (pc->stablemaster_serial>0) return; // dont **show** stabled pets	int sendit;	if (pc->isHidden() && i!=currchar[s] && (pc_currchar->isGM())==0) sendit=0; else sendit=1;	if (!online(i) && (pc->isPlayer()) && (pc_currchar->isGM())==0 ) 	{		sendit=0;		removeitem[1]=pc->ser1;		removeitem[2]=pc->ser2;		removeitem[3]=pc->ser3;		removeitem[4]=pc->ser4;		Xsend(s, removeitem, 5);	}	// hidden chars can only be seen "grey" by themselves or by gm's	// other wise they are invisible=dont send the packet	if (!sendit) return;	oc[0]=0x78; // Message type 78	oc[3]=pc->ser1; // Character serial number	oc[4]=pc->ser2; // Character serial number	oc[5]=pc->ser3; // Character serial number	oc[6]=pc->ser4; // Character serial number	oc[7]=pc->id1; // Character art id	oc[8]=pc->id2; // Character art id	oc[9]=pc->pos.x>>8;	// Character x position	oc[10]=pc->pos.x%256; // Character x position	oc[11]=pc->pos.y>>8; // Character y position	oc[12]=pc->pos.y%256; // Character y position	if (z) oc[13]=pc->dispz; // Character z position	else oc[13]=pc->pos.z;	oc[14]=pc->dir; // Character direction	ShortToCharPtr(pc->skin, &oc[15]); // Character skin color	oc[17]=0; // Character flags	if (pc->isHidden() || !(online(i)||pc->isNpc())) oc[17]=oc[17]|0x80; // Show hidden state correctly	if (pc->poisoned) oc[17]=oc[17]|0x04; //AntiChrist -- thnx to SpaceDog	k=19;	int guild;	guild=Guilds->Compare(currchar[s],i);	if (guild==1)//Same guild (Green)		oc[18]=2;	else if (guild==2) // Enemy guild.. set to orange		oc[18]=5;	else		switch(pc->flag)	{//1=blue 2=green 5=orange 6=Red 7=Transparent(Like skin 66 77a)		case 0x01: oc[18]=6; break;// If a bad, show as red.		case 0x04: oc[18]=1; break;// If a good, show as blue.		case 0x08: oc[18]=2; break; //green (guilds)		case 0x10: oc[18]=5; break;//orange (guilds)		default:   oc[18]=3; break;//grey (Can be pretty much any number.. I like 3 :-)	}	for (j=0;j<MAXLAYERS;j++) layers[j] = 0;	for (ci=0;ci<contsp[pc->serial%HASHMAX].max;ci++)	{		j=contsp[pc->serial%HASHMAX].pointer[ci];		P_ITEM pi = MAKE_ITEM_REF(j);		if (pi != NULL)			if (pc->Wears(pi) && !pi->free)			{				if ( layers[pi->layer] == 0 )				{					LongToCharPtr(pi->serial,oc+k+0);					ShortToCharPtr(pi->id(),oc+k+4);					oc[k+6]=pi->layer;					k=k+7;					if (pi->color1!=0 || pi->color2!=0)					{						oc[k-3] |= 0x80;						oc[k+0]=pi->color1;						oc[k+1]=pi->color2;						k=k+2;					}					layers[pi->layer] = 1;				}				else				{#ifdef DEBUG					ConOut("Double layer (%i) on Item (%i) on Char (%i)\n", pi->layer , j , i);					sprintf(temp, "Double layer (%i) on Item (%2x %2x %2x %2x) on Char (%2x %2x %2x %2x)\n",						pi->layer, pi->ser1, pi->ser2, pi->ser3, pi->ser4,						pc->ser1, pc->ser2, pc->ser3, pc->ser4);					sysbroadcast(temp);#endif				}			}	}	oc[k+0]=0;// Not well understood. It's a serial number. I set this to my serial number,	oc[k+1]=0;// and all of my messages went to my paperdoll gump instead of my character's	oc[k+2]=0;// head, when I was a character with serial number 0 0 0 1.	oc[k+3]=0;	k=k+4;	// unimportant remark: its a packet "terminator" !!! LB	oc[1]=k>>8;	oc[2]=k%256;	Xsend(s, oc, k);}