while ( ((pi=ContainerSearch(pc->serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )
vector<SERIAL> vecContainer = contsp.getData(pc->serial); for ( ci = 0; ci < vecContainer.size(); ci++)
P_ITEM Packitem(P_CHAR pc) // Find packitem{	if(pc==NULL) return NULL;	int i=pc->packitem;	if (i>-1)	{		const P_ITEM pi=MAKE_ITEMREF_LRV(i,NULL);	// on error return -1		if (pc->Wears(pi) && pi->layer==0x15)		{			return pi;		}	}	// - For some reason it's not defined, so go look for it.	int ci=0,loopexit=0;	P_ITEM pi;	while ( ((pi=ContainerSearch(pc->serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )	{		if (pi->layer==0x15)		{			pc->packitem=DEREF_P_ITEM(pi);	//Record it for next time			return (pi);		}	}	return NULL;}