mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Remove unreachable/const logic
Earlier compares result in some logic being unnecessary The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
This commit is contained in:
parent
3138fb20c6
commit
a7ba178005
8 changed files with 14 additions and 15 deletions
|
@ -47,7 +47,7 @@ namespace PKHeX.Core
|
|||
var Gen1Version = GameVersion.RBY;
|
||||
bool RBDragonair = false;
|
||||
|
||||
if (minLevel != 0 && !FilterGBSlotsCatchRate(pkm, ref chain, ref Gen1Version, ref RBDragonair))
|
||||
if (!FilterGBSlotsCatchRate(pkm, ref chain, ref Gen1Version, ref RBDragonair))
|
||||
return Enumerable.Empty<EncounterSlot>();
|
||||
|
||||
var encounterSlots = GetMatchFromEvoLevel(pkm, chain, minLevel);
|
||||
|
|
|
@ -182,14 +182,14 @@ namespace PKHeX.Core
|
|||
return LearnGG.GetIsLevelUp(species, form, move);
|
||||
|
||||
case Any:
|
||||
if (species > MaxSpeciesID_7)
|
||||
return LearnNONE;
|
||||
var first = LearnSM.GetIsLevelUp(species, form, move);
|
||||
if (first.IsLevelUp)
|
||||
return first;
|
||||
if (species > MaxSpeciesID_7_USUM)
|
||||
return LearnNONE;
|
||||
return LearnUSUM.GetIsLevelUp(species, form, move);
|
||||
var first = LearnUSUM.GetIsLevelUp(species, form, move);
|
||||
if (first.IsLevelUp)
|
||||
return first;
|
||||
if (species > MaxSpeciesID_7)
|
||||
return LearnNONE;
|
||||
return LearnSM.GetIsLevelUp(species, form, move);
|
||||
|
||||
case SN: case MN: case SM:
|
||||
if (species > MaxSpeciesID_7)
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace PKHeX.Core
|
|||
return false;
|
||||
|
||||
if ((pkm.VC || pkm.Gen7) && memory != 4) // Generation 7 - Trade memory or nothing
|
||||
return memory == 4;
|
||||
return false;
|
||||
|
||||
if (origin < 6) // NDS/3DS
|
||||
return false;
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace PKHeX.Core
|
|||
if (generation == 2 && lang == (int)LanguageID.Korean)
|
||||
return StringConverter2KOR.LocalizeKOR2(nick);
|
||||
|
||||
if (generation < 5 && (generation != 4 || species != 0)) // All caps GenIV and previous, except GenIV eggs.
|
||||
if (generation != 4 || species != 0) // All caps GenIV and previous, except GenIV eggs.
|
||||
{
|
||||
nick = nick.ToUpper();
|
||||
if (lang == (int)LanguageID.French)
|
||||
|
|
|
@ -52,7 +52,8 @@ namespace PKHeX.Core
|
|||
|
||||
public override void SetRecord(int recordID, int value)
|
||||
{
|
||||
Debug.Assert(recordID < RecordCount);
|
||||
if ((uint)recordID >= RecordCount)
|
||||
throw new ArgumentOutOfRangeException(nameof(recordID));
|
||||
int ofs = GetRecordOffset(recordID);
|
||||
int max = GetRecordMax(recordID);
|
||||
if (value > max)
|
||||
|
|
|
@ -24,7 +24,8 @@ namespace PKHeX.Core
|
|||
|
||||
public override void SetRecord(int recordID, int value)
|
||||
{
|
||||
Debug.Assert(recordID < RecordCount);
|
||||
if ((uint)recordID >= RecordCount)
|
||||
throw new ArgumentOutOfRangeException(nameof(recordID));
|
||||
int ofs = GetRecordOffset(recordID);
|
||||
int max = GetRecordMax(recordID);
|
||||
if (value > max)
|
||||
|
|
|
@ -57,9 +57,6 @@ namespace PKHeX.WinForms
|
|||
|
||||
private void B_Export_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LinkInfo.Data == null)
|
||||
return;
|
||||
|
||||
using var sfd = new SaveFileDialog {Filter = PL6.Filter};
|
||||
if (sfd.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
|
|
|
@ -279,7 +279,7 @@ namespace PKHeX.WinForms
|
|||
private void DiffSaves()
|
||||
{
|
||||
var diff7b = new EventWorkDiff7b(TB_OldSAV.Text, TB_NewSAV.Text);
|
||||
if (diff7b.Message != null)
|
||||
if (diff7b.Message != string.Empty)
|
||||
{
|
||||
WinFormsUtil.Alert(diff7b.Message);
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue