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!
