mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
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:
parent
072f1ba83d
commit
a314ebfbd3
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue