handle hgss volty pikachu trade lang swap

en<->fr
not sure what FR has for the pikachu language (is it EN? if so the code
here works fine); if not, the OT should be checked for lang detection.
This commit is contained in:
Kurt 2017-11-27 23:21:14 -08:00
parent daa49a23a2
commit 1e0bf7b6ea

View file

@ -355,7 +355,12 @@ namespace PKHeX.Core
return;
}
if (pkm.HGSS)
VerifyTradeTable(Encounters4.TradeHGSS, Encounters4.TradeGift_HGSS);
{
int lang = pkm.Language;
if (EncounterMatch.Species == 25 && (lang == 2 || lang == 3)) // EN & FR
lang ^= 1; // toggle for Volty
VerifyTradeTable(Encounters4.TradeHGSS, Encounters4.TradeGift_HGSS, lang);
}
else
{
if (EncounterMatch.Species == 129) // Magikarp
@ -403,7 +408,7 @@ namespace PKHeX.Core
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table) => VerifyTradeTable(ots, table, pkm.Language);
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table, int language)
{
var validOT = language >= ots.Length ? ots[0] : ots[pkm.Language];
var validOT = language >= ots.Length ? ots[0] : ots[language];
var index = Array.IndexOf(table, EncounterMatch);
VerifyTradeOTNick(validOT, index);
}