if (pi != NULL)
if (pContainer != NULL)
void gcollect () // Remove items which were in deleted containers{	int removed = 0, rtotal = 0;	bool bdelete;	LogMessage("Performing Garbage Collection...");		AllItemsIterator iter_items;	for (iter_items.Begin(); iter_items.GetData() != NULL; iter_items++)	{		const P_ITEM pi = iter_items.GetData();		if (pi->free || pi->isInWorld()) 			continue;		bdelete = true;		// find the container if theres one.		if (isCharSerial(pi->contserial))		{			P_CHAR pc = FindCharBySerial(pi->contserial);			if (pc != NULL)				bdelete = false;		}		else		{			P_ITEM pContainer = GetOutmostCont(pi);			if (pi != NULL)				bdelete = false;		}		if (bdelete)		{			Items->DeleItem( pi );			removed++;		}	}	rtotal += removed;		sprintf((char*)temp, " gc: Removed %i items", rtotal);	if (rtotal > 0) LogMessage((char*)temp);}