Add pokewalker early return check

check the middle bits for signs of pokewalker origins
can either be regular or adjusted underflow style

saves a little bit of computation time by not computing compatibility
for obvious non-matches
This commit is contained in:
Kurt 2017-08-28 23:40:04 -07:00
parent 072f1ba83d
commit a314ebfbd3

View file

@ -414,8 +414,15 @@ namespace PKHeX.Core
}
private static bool GetPokewalkerMatch(PKM pk, uint oldpid, out PIDIV pidiv)
{
// check surface compatibility
var mid = oldpid & 0x00FFFF00;
if (mid != 0 && mid != 0x00FFFF00) // not expected bits
{
pidiv = null;
return false;
}
var nature = oldpid % 25;
if (nature == 24)
if (nature == 24) // impossible nature
{
pidiv = null;
return false;