From 33af61af742e9bb7db4141bf6b0ddd94a99c1309 Mon Sep 17 00:00:00 2001 From: Nathan Wichers Date: Tue, 22 Mar 2022 18:42:02 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20Pok=C3=A9mon=20forms=20shift=20in=20Train?= =?UTF-8?q?er=20Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DS_Map/ROMFiles/TrainerFile.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DS_Map/ROMFiles/TrainerFile.cs b/DS_Map/ROMFiles/TrainerFile.cs index 7eec946..0e8d903 100644 --- a/DS_Map/ROMFiles/TrainerFile.cs +++ b/DS_Map/ROMFiles/TrainerFile.cs @@ -197,13 +197,13 @@ namespace DSPRE.ROMFiles { //NOTE: The following bitwise 'AND' operation fixes TUBER JARED [PLAT] and all trainers who //use pokemon with a special form --> ALL PARTY POKEMON WITH A SPECIAL FORM WILL LOSE IT - //the way special forms are stored seems to be something like + //the way special forms are stored is //U16 POKEMON // 0 1 2 3 4 5 6 7 8 9 A B C D E F - //BITS 7 - F --> pokemon ID - //BITS 0 - 6 --> form ID ??? Even numbers only??? - ushort pokemon = (ushort)(reader.ReadUInt16() & (ushort.MaxValue>>7)); + //BITS 6 - F --> pokemon ID + //BITS 0 - 5 --> form ID + ushort pokemon = (ushort)(reader.ReadUInt16() & (ushort.MaxValue>>6)); ushort? heldItem = null; ushort[] moves = null;