diff --git a/PkmnLibSharp/Battling/PokemonParty.cs b/PkmnLibSharp/Battling/PokemonParty.cs index dbe33b3..97f1352 100644 --- a/PkmnLibSharp/Battling/PokemonParty.cs +++ b/PkmnLibSharp/Battling/PokemonParty.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using PkmnLibSharp.Utilities; namespace PkmnLibSharp.Battling @@ -14,9 +15,12 @@ namespace PkmnLibSharp.Battling public PokemonParty(byte size = 6) : base(Creaturelib.Generated.CreatureParty.ConstructWithSize(size)) {} - public PokemonParty(Pokemon[] pokemon) : base( + public PokemonParty(Pokemon?[] pokemon) : base( Creaturelib.Generated.CreatureParty.ConstructFromArray(pokemon.ArrayPtr(), (ulong) pokemon.Length)) - {} + { + for (var index = 0; index < pokemon.Length; index++) + pokemon[index] = null; + } public virtual Pokemon this[int i] => GetAtIndex((ulong) i);