evandixon / SkyEditor.SaveEditor

The Save Editor portion of Sky Editor
MIT License
11 stars 2 forks source link

RBSave doesn't load RBStoredPokemon properly #42

Open RainingChain opened 6 months ago

RainingChain commented 6 months ago

RBSave.LoadStoredPokemon contains a break, but it should be a continue. Otherwise, not all Pokemons are loaded.

            StoredPokemon = new List<RBStoredPokemon>();
            for (int i = 0; i < Offsets.StoredPokemonCount; i++)
            {
                var pkm = new RBStoredPokemon(Bits.GetRange(baseOffset + Offsets.StoredPokemonOffset + i * Offsets.StoredPokemonLength, Offsets.StoredPokemonLength));

                if (pkm.ID <= 0)
                {
                    break;  // Should be changed for continue
                }

                StoredPokemon.Add(pkm);
            }