mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-15 00:21:23 -05:00
Fix sound slots level
This commit is contained in:
parent
f3fd36a9de
commit
270807b04c
|
|
@ -371,6 +371,7 @@ private static EncounterSlot[] getSlots4_HGSS_G(byte[] data, ref int ofs, int nu
|
|||
private static IEnumerable<EncounterSlot> getSlots4_G_Replace(byte[] data, ref int ofs, int slotSize, EncounterSlot[] ReplacedSlots, int[] slotnums, SlotType t = SlotType.Grass)
|
||||
{
|
||||
//Special slots like GBA Dual Slot. Those slot only contain the info of species id, the level is copied from one of the first grass slots
|
||||
//for dppt slotSize = 4, for hgss slotSize = 2
|
||||
var slots = new List<EncounterSlot>();
|
||||
|
||||
int numslots = slotnums.Length;
|
||||
|
|
@ -380,7 +381,7 @@ private static IEnumerable<EncounterSlot> getSlots4_G_Replace(byte[] data, ref i
|
|||
if (baseSlot.LevelMin <= 0)
|
||||
continue;
|
||||
|
||||
int species = BitConverter.ToUInt16(data, ofs + i * slotSize);
|
||||
int species = BitConverter.ToUInt16(data, ofs + i / (4 / slotSize) * slotSize);
|
||||
if (species <= 0)
|
||||
continue;
|
||||
|
||||
|
|
@ -390,7 +391,7 @@ private static IEnumerable<EncounterSlot> getSlots4_G_Replace(byte[] data, ref i
|
|||
slots.Add(slot);
|
||||
}
|
||||
|
||||
ofs += numslots * slotSize;
|
||||
ofs += numslots * slotSize * slotSize / 4;
|
||||
return slots;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ public static partial class Legal
|
|||
|
||||
// Encounter Slots that are replaced
|
||||
internal static readonly int[] Slot4_Time = {2, 3};
|
||||
internal static readonly int[] Slot4_Sound = {4, 5};
|
||||
internal static readonly int[] Slot4_Sound = {2, 3, 4, 5};
|
||||
internal static readonly int[] Slot4_Radar = {6, 7, 10, 11};
|
||||
internal static readonly int[] Slot4_Dual = {8, 9};
|
||||
#region Alt Slots
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user