Prevent nickname change for fateful encounter trades

Handle empty nickname trades for gen6+ assuming there's a nickname
This commit is contained in:
Kurt 2020-10-30 20:31:12 -07:00
parent d7042fb19e
commit 975c4f8a4a

View file

@ -349,7 +349,7 @@ namespace PKHeX.Core
private static CheckResult CheckTradeOTOnly(LegalityAnalysis data, IReadOnlyList<string> validOT) private static CheckResult CheckTradeOTOnly(LegalityAnalysis data, IReadOnlyList<string> validOT)
{ {
var pkm = data.pkm; var pkm = data.pkm;
if (pkm.IsNicknamed && pkm.Format < 8) if (pkm.IsNicknamed && (pkm.Format < 8 || pkm.FatefulEncounter))
return GetInvalid(LEncTradeChangedNickname, CheckIdentifier.Nickname); return GetInvalid(LEncTradeChangedNickname, CheckIdentifier.Nickname);
int lang = pkm.Language; int lang = pkm.Language;
if (validOT.Count <= lang) if (validOT.Count <= lang)
@ -363,6 +363,9 @@ namespace PKHeX.Core
{ {
var ot = t.GetOT(language); var ot = t.GetOT(language);
var nick = t.GetNickname(language); var nick = t.GetNickname(language);
if (string.IsNullOrEmpty(nick))
VerifyTradeOTOnly(data, t);
else
VerifyTradeOTNick(data, t, nick, ot); VerifyTradeOTNick(data, t, nick, ot);
} }