Added WC9 file recognition (#3637)

* Added WC9 file recognition

* WC9 recognition in GetMysteryGift without ext param
This commit is contained in:
Manu 2022-11-25 15:50:00 +01:00 committed by GitHub
parent b4253909d7
commit c1a4baecdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,7 @@ public abstract class MysteryGift : IEncounterable, IMoveset, IRelearn
WC8.Size when ext is ".wc8" or ".wc8full" => new WC8(data), WC8.Size when ext is ".wc8" or ".wc8full" => new WC8(data),
WB8.Size when ext is ".wb8" => new WB8(data), WB8.Size when ext is ".wb8" => new WB8(data),
WA8.Size when ext is ".wa8" => new WA8(data), WA8.Size when ext is ".wa8" => new WA8(data),
WC9.Size when ext is ".wc9" => new WC9(data),
WB7.SizeFull when ext == ".wb7full" => new WB7(data), WB7.SizeFull when ext == ".wb7full" => new WB7(data),
WC6Full.Size when ext == ".wc6full" => new WC6Full(data).Gift, WC6Full.Size when ext == ".wc6full" => new WC6Full(data).Gift,
@ -57,7 +58,9 @@ public abstract class MysteryGift : IEncounterable, IMoveset, IRelearn
WR7.Size => new WR7(data), WR7.Size => new WR7(data),
WC8.Size => new WC8(data), WC8.Size => new WC8(data),
WB8.Size => new WB8(data), WB8.Size => new WB8(data),
WA8.Size => new WA8(data),
// WA8/WC9: WA8 CardType >0 for wa8, 0 for wc9.
WA8.Size => data[0xF] > 0 ? new WA8(data) : new WC9(data),
// WC6/WC7: Check year // WC6/WC7: Check year
WC6.Size => ReadUInt32LittleEndian(data.AsSpan(0x4C)) / 10000 < 2000 ? new WC7(data) : new WC6(data), WC6.Size => ReadUInt32LittleEndian(data.AsSpan(0x4C)) / 10000 < 2000 ? new WC7(data) : new WC6(data),