mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-30 15:59:13 +00:00
Prevent nickname change for fateful encounter trades
Handle empty nickname trades for gen6+ assuming there's a nickname
This commit is contained in:
parent
d7042fb19e
commit
975c4f8a4a
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue