mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-14 08:17:14 +00:00
Fix item transferral
Instead of just copying the value, get the corresponding transferred value (and sanity check; the getG4Item returns 0x80 if held item does not correspond to a sprite). Closes #665
This commit is contained in:
parent
a6e84f5aa9
commit
67838e4643
2 changed files with 9 additions and 2 deletions
|
@ -290,9 +290,12 @@ namespace PKHeX
|
|||
// Unown Form
|
||||
pk4.AltForm = AltForm;
|
||||
|
||||
int item = HeldItem;
|
||||
if (HeldItem > 0)
|
||||
pk4.HeldItem = item;
|
||||
{
|
||||
ushort item = PKX.getG4Item((ushort)HeldItem);
|
||||
if (PKX.isTransferrable34(item))
|
||||
pk4.HeldItem = item;
|
||||
}
|
||||
|
||||
// Remove HM moves
|
||||
int[] banned = { 15, 19, 57, 70, 148, 249, 127, 291 };
|
||||
|
|
|
@ -1949,6 +1949,10 @@ namespace PKHeX
|
|||
ushort val = g3val > arr.Length ? ushort.MaxValue : arr[g3val];
|
||||
return val == ushort.MaxValue ? ITEM_UNK : val;
|
||||
}
|
||||
public static bool isTransferrable34(ushort item)
|
||||
{
|
||||
return item == ITEM_UNK && item > 0;
|
||||
}
|
||||
|
||||
#region Gen 1 Character Tables
|
||||
private static Dictionary<byte, string> RBY2U_U => new Dictionary<byte, string>{
|
||||
|
|
Loading…
Reference in a new issue