public static void PackParty(this Combat.Pokemon[] Party) { Combat.Pokemon[] packedArray = new Combat.Pokemon[Party.Length]; int i2 = 0; //counter for packed array for (int i = 0; i < Party.Length; i++) { if (Party[i].IsNotNullOrNone()) // != null || Party[i].Species != Pokemons.NONE) { //if next object in box has a value packedArray[i2] = Party[i]; //add to packed array i2 += 1; //ready packed array's next position } } for (int i = 0; i < Party.Length; i++) { Party[i] = packedArray[i]; } }