diff --git a/PKHeX.Core/Legality/LearnSource/Sources/LearnSource4HGSS.cs b/PKHeX.Core/Legality/LearnSource/Sources/LearnSource4HGSS.cs index faa2626dd..72a394ec6 100644 --- a/PKHeX.Core/Legality/LearnSource/Sources/LearnSource4HGSS.cs +++ b/PKHeX.Core/Legality/LearnSource/Sources/LearnSource4HGSS.cs @@ -154,7 +154,7 @@ public void GetAllMoves(Span result, PKM pk, EvoCriteria evo, MoveSourceTy result[moves[i]] = true; } } - + if (types.HasFlag(MoveSourceType.SpecialTutor)) pi.SetAllLearnTutorType(result, Tutors_4); diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo4.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo4.cs index 467a90ee2..819bdb9ea 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo4.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo4.cs @@ -96,10 +96,10 @@ public void SetIsLearnTM(int index, bool value) public void SetAllLearnTM(Span result, ReadOnlySpan moves) { var span = Data.AsSpan(TMHM, ByteCountTM); - for (int i = CountTM - 1; i >= 0; i--) + for (int index = CountTM - 1; index >= 0; index--) { - if ((span[i >> 3] & (i & 7)) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -119,10 +119,10 @@ public void SetIsLearnTutorType(int index, bool value) public void SetAllLearnTutorType(Span result, ReadOnlySpan moves) { - for (int i = CountTutor - 1; i >= 0; i--) + for (int index = CountTutor - 1; index >= 0; index--) { - if (TypeTutors[i]) - result[moves[i]] = true; + if (TypeTutors[index]) + result[moves[index]] = true; } } @@ -137,10 +137,10 @@ public bool GetIsLearnHM(int index) public void SetAllLearnHM(Span result, ReadOnlySpan moves) { var span = Data.AsSpan(TMHM, ByteCountTM); - for (int i = CountTM + CountHM - 1; i >= CountTM; i--) + for (int index = CountTM + CountHM - 1; index >= CountTM; index--) { - if ((span[i >> 3] & (i & 7)) != 0) - result[moves[i - CountTM]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index - CountTM]] = true; } } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo6AO.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo6AO.cs index 57e7488d4..c9b521288 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo6AO.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo6AO.cs @@ -95,10 +95,10 @@ public void SetIsLearnTM(int index, bool value) public void SetAllLearnTM(Span result, ReadOnlySpan moves) { var span = Data.AsSpan(TMHM, ByteCountTM); - for (int i = CountTMHM - 1; i >= 0; i--) + for (int index = CountTMHM - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -122,10 +122,10 @@ public void SetIsLearnTutorType(int index, bool value) public void SetAllLearnTutorType(Span result, ReadOnlySpan moves) { var tutor = Data[TypeTutor]; - for (int i = TypeTutorCount - 1; i >= 0; i--) + for (int index = TypeTutorCount - 1; index >= 0; index--) { - if ((tutor & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((tutor & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo6XY.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo6XY.cs index 436f53172..d77f10f8e 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo6XY.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo6XY.cs @@ -95,10 +95,10 @@ public void SetIsLearnTM(int index, bool value) public void SetAllLearnTM(Span result, ReadOnlySpan moves) { var span = Data.AsSpan(TMHM, ByteCountTM); - for (int i = CountTMHM - 1; i >= 0; i--) + for (int index = CountTMHM - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -122,10 +122,10 @@ public void SetIsLearnTutorType(int index, bool value) public void SetAllLearnTutorType(Span result, ReadOnlySpan moves) { var tutor = Data[TypeTutor]; - for (int i = TypeTutorCount - 1; i >= 0; i--) + for (int index = TypeTutorCount - 1; index >= 0; index--) { - if ((tutor & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((tutor & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo7.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo7.cs index b1084dc4b..21a28ac7d 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo7.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo7.cs @@ -100,10 +100,10 @@ public void SetIsLearnTM(int index, bool value) public void SetAllLearnTM(Span result, ReadOnlySpan moves) { var span = Data.AsSpan(TMHM, ByteCountTM); - for (int i = CountTMHM - 1; i >= 0; i--) + for (int index = CountTMHM - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -127,10 +127,10 @@ public void SetIsLearnTutorType(int index, bool value) public void SetAllLearnTutorType(Span result, ReadOnlySpan moves) { var tutor = Data[TypeTutor]; - for (int i = TypeTutorCount - 1; i >= 0; i--) + for (int index = TypeTutorCount - 1; index >= 0; index--) { - if ((tutor & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((tutor & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -157,10 +157,10 @@ public void SetAllLearnTutorSpecial(Span result) { var moves = Tutors_USUM; var span = Data.AsSpan(Tutor1, ByteCountTutor1); - for (int i = 0; i < moves.Length; i++) + for (int index = 0; index < moves.Length; index++) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo8LA.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo8LA.cs index 9d028c338..21c5378eb 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo8LA.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo8LA.cs @@ -193,10 +193,10 @@ public void SetAllLearnMoveShop(Span result) { var moves = MoveShopMoves; var bits = MoveShopBits; - for (int i = 0 ; i < MoveShopCount; i++) + for (int index = 0 ; index < MoveShopCount; index++) { if ((bits & 1) == 1) - result[moves[i]] = true; + result[moves[index]] = true; bits >>= 1; } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo8SWSH.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo8SWSH.cs index 906185234..61195307e 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo8SWSH.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo8SWSH.cs @@ -116,10 +116,10 @@ public void SetAllLearnTM(Span result) { var moves = TM_SWSH; var span = Data.AsSpan(TM, ByteCountTM); - for (int i = moves.Length - 1; i >= 0; i--) + for (int index = moves.Length - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -161,10 +161,10 @@ public void SetAllLearnTutorType(Span result) { var moves = TypeTutor8; var tutor = Data[TutorType]; - for (int i = moves.Length - 1; i >= 0; i--) + for (int index = moves.Length - 1; index >= 0; index--) { - if ((tutor & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((tutor & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -189,10 +189,10 @@ public void SetAllLearnTutorSpecial(Span result) { var moves = Tutors_SWSH; var span = Data.AsSpan(TutorArmor, 3); - for (int i = moves.Length - 1; i >= 0; i--) + for (int index = moves.Length - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } @@ -200,10 +200,10 @@ public void SetAllLearnTR(Span result) { var moves = TR_SWSH; var span = Data.AsSpan(TR, ByteCountTM); - for (int i = moves.Length - 1; i >= 0; i--) + for (int index = moves.Length - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } diff --git a/PKHeX.Core/PersonalInfo/Info/PersonalInfo9SV.cs b/PKHeX.Core/PersonalInfo/Info/PersonalInfo9SV.cs index 069ec5980..13a062d8e 100644 --- a/PKHeX.Core/PersonalInfo/Info/PersonalInfo9SV.cs +++ b/PKHeX.Core/PersonalInfo/Info/PersonalInfo9SV.cs @@ -102,10 +102,10 @@ public void SetAllLearnTM(Span result) { var moves = TM_SV; var span = Data.AsSpan(TM, ByteCountTM); - for (int i = CountTM - 1; i >= 0; i--) + for (int index = CountTM - 1; index >= 0; index--) { - if ((span[i >> 3] & (1 << (i & 7))) != 0) - result[moves[i]] = true; + if ((span[index >> 3] & (1 << (index & 7))) != 0) + result[moves[index]] = true; } } diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index d51fe70df..299c93075 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -341,6 +341,7 @@ public void UpdateLegality(LegalityAnalysis? la = null, UpdateLegalityArgs args LegalityChanged?.Invoke(Legality.Valid, EventArgs.Empty); return; } + MC_Move1.HideLegality = MC_Move2.HideLegality = MC_Move3.HideLegality = MC_Move4.HideLegality = false; // Refresh Move Legality var info = Legality.Info;