From b6f2dd623e6f4c87b3adc3c95bd062f1625cfe07 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 22 Nov 2019 22:22:25 -0800 Subject: [PATCH] Fix external drag restoring of image Closes #2476 --- PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 46d575476..c56064ca1 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -136,6 +136,7 @@ private void HandleMovePKM(PictureBox pb, bool encrypt) // Prepare Data Drag.Info.Source = GetSlotInfo(pb); + Drag.Info.Destination = null; // Make a new file name based off the PID string newfile = CreateDragDropPKM(pb, encrypt, out bool external); @@ -192,7 +193,7 @@ private bool TryMakeDragDropPKM(PictureBox pb, byte[] data, string newfile) // Thread Blocks on DoDragDrop Drag.Info.CurrentPath = newfile; var result = pb.DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move); - var external = Drag.Info.Source == null || result != DragDropEffects.Link; + var external = Drag.Info.Destination == null || result != DragDropEffects.Link; if (external || Drag.Info.Source.Equals(Drag.Info.Destination)) // not dropped to another box slot, restore img { pb.Image = img;