View Single Post
  #5  
Old 05-24-2011, 07:19 PM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Maybe it is worth always checking that an object exists before doing smth with it, e.g.
Code:
        {
            if (bp != null)
                bp.destroy();         
        }
Code:
 {
                if (enemyGG[i] != null)
                    if (result.Pos().distance(ref attackerPos) > enemyGG[i].Pos().distance(ref attackerPos)) 
                        { result = enemyGG[i]; }
            }
Reply With Quote