mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-26 18:15:43 -05:00
Fix wc7 deletion
shift down logic does not apply for array writes; the setter sets empty slots to fill all required slots Closes #1142
This commit is contained in:
@@ -980,11 +980,6 @@ private void setWC6(MysteryGift wc6, int index)
|
||||
|
||||
wc6.Data.CopyTo(Data, WondercardData + index * WC6.Size);
|
||||
|
||||
for (int i = 0; i < GiftCountMax; i++)
|
||||
if (getData(WondercardData + i * WC6.Size, WC6.Size).All(b => b == 0)) // empty
|
||||
for (int j = i + 1; j < GiftCountMax - i; j++) // Shift everything down
|
||||
Array.Copy(Data, WondercardData + j * WC6.Size, Data, WondercardData + (j - 1) * WC6.Size, WC6.Size);
|
||||
|
||||
Edited = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1226,11 +1226,6 @@ private void setWC7(MysteryGift wc7, int index)
|
||||
|
||||
wc7.Data.CopyTo(Data, WondercardData + index * WC7.Size);
|
||||
|
||||
for (int i = 0; i < GiftCountMax; i++)
|
||||
if (getData(WondercardData + i * WC7.Size, WC7.Size).All(b => b == 0)) // empty
|
||||
for (int j = i + 1; j < GiftCountMax - i; j++) // Shift everything down
|
||||
Array.Copy(Data, WondercardData + j * WC7.Size, Data, WondercardData + (j - 1) * WC7.Size, WC7.Size);
|
||||
|
||||
Edited = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user