From 5a21b70d116cd488092474f01ef65c5974fce4cf Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Mon, 9 May 2016 17:51:35 -0700 Subject: [PATCH] Rearrange logic for Location Get game ID once, check pk6 game first. Will be easy to insert a third case if/when the time comes. --- Legality/Checks.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Legality/Checks.cs b/Legality/Checks.cs index ff74f0356..b55c1de82 100644 --- a/Legality/Checks.cs +++ b/Legality/Checks.cs @@ -687,10 +687,12 @@ private LegalityCheck verifyOTMemory() return new LegalityCheck(Severity.Invalid, "OT Memory: Link Trade is not a valid first memory."); case 6: // {0} went to the Pokémon Center in {2} with {1} and had its tired body healed there. {4} that {3}. int matchingOriginGame = Array.IndexOf(Legal.LocationsWithPKCenter[0], pk6.OT_TextVar); - if (matchingOriginGame != -1) { - if ((Legal.LocationsWithPKCenter[1][matchingOriginGame] == 1 && pk6.XY) || ((Legal.LocationsWithPKCenter[1][matchingOriginGame] == 0 && pk6.AO))) + if (matchingOriginGame != -1) + { + int gameID = Legal.LocationsWithPKCenter[1][matchingOriginGame]; + if (pk6.XY && gameID != 0 || pk6.AO && gameID != 1) return new LegalityCheck(Severity.Invalid, "OT Memory: Location doesn't exist on Origin Game region."); - } + } return verifyCommonMemory(0); case 14: if (!Legal.getCanBeCaptured(pk6.OT_TextVar, pk6.Version))