Fix for baby species to return the right species when checked with items (#60)

This fixes a bug in the baby species determination when both parents are holding an item, creating an egg that's fully evolved
Also fixes a related bug, in which it doesn't check items when doing a recursive baby species check, effectively ignoring incense if it has to recurse before reaching the incense'd mon.
This commit is contained in:
Vendily
2020-11-10 16:05:10 -05:00
committed by GitHub
parent 0301e2e947
commit c87a578021

View File

@@ -157,13 +157,13 @@ def pbGetBabySpecies(species,item1=-1,item2=-1)
next if !evo[3]
if item1>=0 && item2>=0
incense = pbGetSpeciesData(evo[0],0,SpeciesIncense)
ret = evo[0] if item1==incense || item2==incense
ret = evo[0] if incense==0 || incense==item1 || incense==item2
else
ret = evo[0] # Species of prevolution
end
break
end
ret = pbGetBabySpecies(ret) if ret!=species
ret = pbGetBabySpecies(ret,item1,item2) if ret!=species
return ret
end