Add treasure items to valid held item table

This commit is contained in:
Kurt 2019-11-15 19:50:22 -08:00
parent ab7e920410
commit 025e36c5fc
2 changed files with 19 additions and 1 deletions

View File

@ -181,7 +181,7 @@ public static partial class Legal
1105, 1106, 1107, 1108,
};
internal static readonly ushort[] HeldItems_SWSH = new ushort[1].Concat(Pouch_Items_SWSH).Concat(Pouch_Berries_SWSH).Concat(Pouch_Medicine_SWSH).Concat(TR_SWSH).ToArray();
internal static readonly ushort[] HeldItems_SWSH = ArrayUtil.ConcatAll(new ushort[1], Pouch_Items_SWSH, Pouch_Berries_SWSH, Pouch_Medicine_SWSH, TR_SWSH, Pouch_Treasure_SWSH);
internal static readonly HashSet<int> WildPokeballs8 = new HashSet<int> {
(int)Ball.Poke,

View File

@ -160,5 +160,23 @@ public static int CopyTo<T>(this IEnumerable<T> list, IList<T> dest, int start =
}
return ctr - start;
}
internal static T[] ConcatAll<T>(params T[][] arr)
{
int len = 0;
foreach (var a in arr)
len += a.Length;
var result = new T[len];
int ctr = 0;
for (int i = 0; i < arr.Length; i++)
{
arr[i].CopyTo(result, ctr);
ctr += arr[i].Length;
}
return result;
}
}
}