Thread: Null exception
View Single Post
  #2  
Old 03-13-2012, 04:23 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

if you have a list for example:

List<AiAircraft> PlaneList = new List<AiAircraft>();

PlaneList.Add(aircraft1); // only examples
PlaneList.Add(aircraft2);


aircraft2.Destroy();

So now we have the aircraft2 already in List. Maybe more of destroyed Aircrafts. To remove them from List:
PlaneList.RemoveAll(item => item == null); // removes all null valued Aircrafts from list.
Reply With Quote