Fix g4 move tutor lookup

personalinfo setup wasn't populating info for form indexes
remove erroneous pid-type mismatch message on gen3/4 non-matching if
there are no deferred encounters
This commit is contained in:
Kurt 2017-08-27 11:04:31 -07:00
parent 896427a848
commit c627a86f8c
3 changed files with 5 additions and 2 deletions

View File

@ -2046,7 +2046,7 @@ internal static IEnumerable<int> GetTutorMoves(PKM pkm, int species, int form, b
break;
case 4:
info = PersonalTable.HGSS[species];
info = PersonalTable.HGSS.GetFormeEntry(species, form);
moves.AddRange(Tutors_4.Where((t, i) => info.TypeTutors[i]));
moves.AddRange(SpecialTutors_4.Where((t, i) => SpecialTutors_Compatibility_4[i].Any(e => e == species)));
break;

View File

@ -76,6 +76,9 @@ private static IEnumerable<IEncounterable> GetEncounters4(PKM pkm, LegalInfo inf
else
deferred.Add(z);
}
if (deferred.Count == 0)
yield break;
info.PIDIVMatches = false;
foreach (var z in deferred)
yield return z;

View File

@ -111,7 +111,7 @@ private static void PopulateGen3Tutors()
private static void PopulateGen4Tutors()
{
var tutors = Data.UnpackMini(Util.GetBinaryResource("tutors_g4.pkl"), "g4");
for (int i = 0; i <= Legal.MaxSpeciesID_4; i++)
for (int i = 0; i < tutors.Length; i++)
HGSS[i].AddTypeTutors(tutors[i]);
}