mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-13 01:05:33 -05:00
Fix gen3 emerald badge setter
Closes #1452 the bitwise or treated it as an int, which wrote 4 bytes instead of 2, thus overwriting 16 flyto flags Thanks @sora10pls & @Tk77185!
This commit is contained in:
@@ -326,7 +326,8 @@ public int Badges
|
||||
switch (Version)
|
||||
{
|
||||
case GameVersion.E:
|
||||
BitConverter.GetBytes(BitConverter.ToUInt16(Data, BlockOfs[2] + 0x3FC) & ~(0xFF << 7) | (value << 7)).CopyTo(Data, BlockOfs[2] + 0x3FC);
|
||||
var val = BitConverter.ToUInt16(Data, BlockOfs[2] + 0x3FC) & ~(0xFF << 7) | (value << 7);
|
||||
BitConverter.GetBytes((ushort)val).CopyTo(Data, BlockOfs[2] + 0x3FC);
|
||||
break;
|
||||
case GameVersion.FRLG: Data[BlockOfs[2] + 0x64] = (byte)value; break;
|
||||
default: return; // RS
|
||||
|
||||
Reference in New Issue
Block a user