Skip to content

Commit

Permalink
Only modify SAV OT name if modified
Browse files Browse the repository at this point in the history
resolves gen1 pikachu forgetting the original OT
  • Loading branch information
kwsch committed Oct 5, 2017
1 parent 413cfdd commit 1a343ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PKHeX.WinForms/Subforms/Save Editors/SAV_SimpleTrainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ public SAV_SimpleTrainer(SaveFile sav)
cba = new[] { CHK_1, CHK_2, CHK_3, CHK_4, CHK_6, CHK_5, CHK_7, CHK_8, CHK_H1, CHK_H2, CHK_H3, CHK_H4, CHK_H5, CHK_H6, CHK_H7, CHK_H8 };
}

if (SAV is SAV3)
if (SAV is SAV3 sav3)
{
GB_Map.Visible = false;
SAV3 sav3 = (SAV3)SAV;
switch (sav3.Version)
{
case GameVersion.E: badgeval = sav3.Badges; break;
Expand Down Expand Up @@ -167,7 +166,8 @@ private void Change255(object sender, EventArgs e)

private void B_Save_Click(object sender, EventArgs e)
{
SAV.OT = TB_OTName.Text;
if (SAV.OT != TB_OTName.Text) // only modify if changed (preserve trash bytes?)
SAV.OT = TB_OTName.Text;
SAV.Gender = (byte)CB_Gender.SelectedIndex;

SAV.TID = (ushort)Util.ToUInt32(MT_TID.Text);
Expand Down

0 comments on commit 1a343ea

Please sign in to comment.