--iter_items;
bool atBegin = false;
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.atEnd(); ++iter_items)	{		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 (pContainer != NULL)				bdelete = false;		}		if (bdelete)		{			--iter_items; // Go back for a little.			Items->DeleItem( pi ); // Warning, iterator became invalid!			removed++;		}	}	rtotal += removed;		sprintf((char*)temp, " gc: Removed %i items", rtotal);	if (rtotal > 0) LogMessage((char*)temp);}