From 6d0b4f77e4e231e8fa1d83386f326fc4ca872981 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 21 Dec 2023 19:04:08 -0800 Subject: [PATCH] Fix Gen2 quick hidden power calc --- PKHeX.Core/Editing/HiddenPower.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Editing/HiddenPower.cs b/PKHeX.Core/Editing/HiddenPower.cs index 15db2bf98..1ca9ce847 100644 --- a/PKHeX.Core/Editing/HiddenPower.cs +++ b/PKHeX.Core/Editing/HiddenPower.cs @@ -97,7 +97,7 @@ public static int GetTypeGB(ReadOnlySpan IVs) } /// - public static int GetTypeGB(ushort u16) => ((u16 >> 12) & 0b1100) | ((u16 >> 8) & 0b11); + public static int GetTypeGB(ushort u16) => ((u16 >> 10) & 0b1100) | ((u16 >> 8) & 0b11); /// /// Modifies the provided to have the requested for Generations 1 & 2 @@ -116,7 +116,7 @@ public static bool SetTypeGB(int hiddenPowerType, Span IVs) public static ushort SetTypeGB(int hiddenPowerType, ushort current) { // Extract bits from ATK and DEF. - var u16 = ((hiddenPowerType & 0b1100) << 12) | ((hiddenPowerType & 0b11) << 8); + var u16 = ((hiddenPowerType & 0b1100) << 10) | ((hiddenPowerType & 0b11) << 8); return (ushort)((current & 0b1100_1100_1111_1111) | u16); }