int p=packitem(currchar[s]); if (p==-1) return;
P_CHAR pc_currchar = MAKE_CHAR_REF(currchar[s]); P_ITEM pi_pack = Packitem(pc_currchar); if (pi_pack == NULL) return;
static void AnvilTarget2(int s,				// socket #						 P_ITEM pi,			// material item						 int ma,			// minimum amount						 int mm,			// makemenu # to invoke from create.scp						 char* matname)		// name of the metal{	if (!AnvilInRange(s))		sysmessage(s,"The anvil is too far away.");	else	{		int p=packitem(currchar[s]);		if (p==-1) return;		int amt=items[p].CountItems( pi->id(), pi->color());//		int amt=ContainerCountItems(items[p].serial, pi->id(), pi->color());//		int amt=Skills->GetIngotAmt(items[p].serial, //									pi->id1,pi->id2,			// item ID//									pi->color1,pi->color2);	// color		if ((itemmake[s].has=amt) < ma)		{			char msg[100];			sprintf(msg,"You don't have enough %s ingots to make anything.",matname);			sysmessage(s,msg);		}		else			Skills->MakeMenu(s,mm,BLACKSMITHING);	}}