Tweak party undo/redo logic

This commit is contained in:
Kurt 2022-10-09 16:15:50 -07:00
parent d9b4a0c771
commit 58f729122e
2 changed files with 3 additions and 2 deletions

View file

@ -105,7 +105,7 @@ public sealed class SlotEditor<T>
if (!Changelog.CanUndo)
return;
var slot = Changelog.Undo();
NotifySlotChanged(slot, SlotTouchType.Set, slot.Read(SAV));
NotifySlotChanged(slot, SlotTouchType.Delete, slot.Read(SAV));
}
public void Redo()
@ -113,6 +113,6 @@ public sealed class SlotEditor<T>
if (!Changelog.CanRedo)
return;
var slot = Changelog.Redo();
NotifySlotChanged(slot, SlotTouchType.Set, slot.Read(SAV));
NotifySlotChanged(slot, SlotTouchType.Delete, slot.Read(SAV));
}
}

View file

@ -232,6 +232,7 @@ public abstract class SaveFile : ITrainerInfo, IGameValueLimit, IBoxDetailWallpa
int ctr = 0;
foreach (var exist in value.Where(pk => pk.Species != 0))
SetPartySlot(exist, PartyBuffer, GetPartyOffset(ctr++));
PartyCount = ctr;
for (int i = ctr; i < 6; i++)
SetPartySlot(BlankPKM, PartyBuffer, GetPartyOffset(i));
}