void item_char_test()
static void item_char_test()
void item_char_test(){	LogMessage( "Starting item consistancy check" );		AllItemsIterator iterItems;	for (iterItems.Begin(); !iterItems.atEnd(); iterItems++)	{		P_ITEM pi = iterItems.GetData();		if( pi->serial == pi->contserial )		{			clConsole.send( QString( "ALERT ! item %1 [serial: %2] has dangerous container value, autocorrecting\n" ).arg( pi->name() ).arg( pi->serial ) );			//pi->setContSerial( -1 );		}		if( pi->serial == pi->GetOwnSerial() )		{			clConsole.send( QString( "ALERT ! item %1 [serial: %2] has dangerous owner value\n" ).arg( pi->name() ).arg( pi->serial ) );			pi->SetOwnSerial( -1 );		}		if( pi->serial == pi->spawnserial )		{			clConsole.send( QString( "ALERT ! item %1 [serial: %2] has dangerous spawn value\n" ).arg( pi->name() ).arg( pi->serial ) );			pi->SetSpawnSerial( -1 );		}	}	// check for stabled pets that dont have a stablemaster anymore	P_CHAR p_pet;	int stablemaster_serial;	AllCharsIterator iter_char;	for ( iter_char.Begin(); !iter_char.atEnd(); iter_char++)	{		p_pet = iter_char.GetData();		if (p_pet != NULL)		{			 stablemaster_serial = p_pet->stablemaster_serial();			 if (stablemaster_serial != INVALID_SERIAL) // stabled ?			 {				P_CHAR pc_j = FindCharBySerial(stablemaster_serial);				if (pc_j == NULL)				{					stablesp.remove(stablemaster_serial, p_pet->serial);					p_pet->setStablemaster_serial(INVALID_SERIAL);					p_pet->setTimeused_last(getNormalizedTime());					p_pet->setTime_unused(0);					cMapObjects::getInstance()->add(p_pet);					LogMessage("Stabled animal got freed because stablemaster died");					clConsole.send("stabled animal got freed because stablemaster died");				}			 }		}	}}