mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-10 22:00:16 -05:00
parent
07690e2919
commit
ebecb21b2e
|
|
@ -20,7 +20,7 @@ public ShadowInfoTableXD(byte[] data)
|
|||
Array.Copy(data, i*eSize, d, 0, eSize);
|
||||
|
||||
var entry = new ShadowInfoEntryXD(d);
|
||||
if (entry.Species != 0)
|
||||
//if (entry.Species != 0)
|
||||
Entries.Add(entry);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public class StrategyMemo
|
|||
private const int SIZE_ENTRY = 12;
|
||||
private readonly List<StrategyMemoEntry> Entries = new List<StrategyMemoEntry>();
|
||||
private StrategyMemoEntry this[int Species] => Entries.FirstOrDefault(e => e.Species == Species);
|
||||
private readonly byte[] _unk;
|
||||
|
||||
public StrategyMemo(byte[] input, int offset, bool xd)
|
||||
{
|
||||
|
|
@ -17,6 +18,7 @@ public StrategyMemo(byte[] input, int offset, bool xd)
|
|||
int count = BigEndian.ToInt16(input, offset);
|
||||
if (count > 500)
|
||||
count = 500;
|
||||
_unk = input.Skip(offset + 2).Take(2).ToArray();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
byte[] data = new byte[SIZE_ENTRY];
|
||||
|
|
@ -24,8 +26,8 @@ public StrategyMemo(byte[] input, int offset, bool xd)
|
|||
Entries.Add(new StrategyMemoEntry(XD, data));
|
||||
}
|
||||
}
|
||||
public byte[] FinalData => BigEndian.GetBytes(Entries.Count) // count followed by populated entries
|
||||
.Concat(Entries.Where(entry => entry.Species != 0).SelectMany(entry => entry.Data)).ToArray();
|
||||
public byte[] FinalData => BigEndian.GetBytes((short)Entries.Count).Concat(_unk) // count followed by populated entries
|
||||
.Concat(Entries.SelectMany(entry => entry.Data)).ToArray();
|
||||
|
||||
public StrategyMemoEntry GetEntry(int Species)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user