View Single Post
Old 08-06-2008, 02:21 PM   #2 (permalink)
vermillion2083
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

you would do something like this:

Code:
		if ( from == null || from.Deleted )
			m_List.Remove( from );
EDIT:

You are going to want to cycle through the list and perform this task on each mobile stored in the list before sending it to the gump so that the information displayed on the gump is correct. You would do that with something simular to the following:

Code:
		public override void OnDoubleClick( Mobile from )
		{
			CleanList();
			from.SendGump(new ListGump( m_List ));
		}

		public void CleanList()
		{
			for ( int i = 0; i < m_List.Count; ++i )
			{
				Mobile from = m_List[i];
				if ( from == null || from.Deleted )
					m_List.Remove( from );
			}
		}
I accidentally hit the back key and had to write this twice *grins*. I hope this helps, good luck with your project!
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum

Last edited by vermillion2083; 08-06-2008 at 02:29 PM.
vermillion2083 is offline   Reply With Quote