Merge pull request #924 from kamronbatman/fixed_gen3_eggs

Fixes gen 3 egg name and language.
This commit is contained in:
Kaphotics 2017-03-06 22:11:03 -08:00 committed by GitHub
commit 3aa772bf22

View file

@ -43,11 +43,11 @@ namespace PKHeX.Core
public override int SID { get { return BitConverter.ToUInt16(Data, 0x06); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x06); } }
public override string Nickname {
get { return PKX.getG3Str(Data.Skip(0x08).Take(10).ToArray(), Japanese); }
set { byte[] strdata = PKX.setG3Str(value, Japanese);
set { byte[] strdata = PKX.setG3Str(IsEgg ? "タマゴ" : value, Japanese);
if (strdata.Length > 10)
Array.Resize(ref strdata, 10);
strdata.CopyTo(Data, 0x08); } }
public override int Language { get { return BitConverter.ToUInt16(Data, 0x12) & 0xFF; } set { BitConverter.GetBytes((ushort)(value | 0x200)).CopyTo(Data, 0x12); } }
public override int Language { get { return BitConverter.ToUInt16(Data, 0x12) & 0xFF; } set { BitConverter.GetBytes((ushort)(IsEgg ? 0x601 : value | 0x200)).CopyTo(Data, 0x12); } }
public override string OT_Name {
get { return PKX.getG3Str(Data.Skip(0x14).Take(7).ToArray(), Japanese); }
set { byte[] strdata = PKX.setG3Str(value, Japanese);
@ -159,7 +159,7 @@ namespace PKHeX.Core
// Generated Attributes
public override int PSV => (int)((PID >> 16 ^ PID & 0xFFFF) >> 3);
public override int TSV => (TID ^ SID) >> 3;
public bool Japanese => Language == 1;
public bool Japanese => IsEgg || Language == 1;
public override byte[] Encrypt()
{