Fix sound slots level

This commit is contained in:
wwwwwwzx 2017-03-26 04:14:00 -07:00
parent f3fd36a9de
commit 270807b04c
2 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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