mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +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)
|
||||
{
|
||||
var pkm = data.pkm;
|
||||
if (pkm.IsNicknamed && pkm.Format < 8)
|
||||
if (pkm.IsNicknamed && (pkm.Format < 8 || pkm.FatefulEncounter))
|
||||
return GetInvalid(LEncTradeChangedNickname, CheckIdentifier.Nickname);
|
||||
int lang = pkm.Language;
|
||||
if (validOT.Count <= lang)
|
||||
|
@ -363,7 +363,10 @@ namespace PKHeX.Core
|
|||
{
|
||||
var ot = t.GetOT(language);
|
||||
var nick = t.GetNickname(language);
|
||||
VerifyTradeOTNick(data, t, nick, ot);
|
||||
if (string.IsNullOrEmpty(nick))
|
||||
VerifyTradeOTOnly(data, t);
|
||||
else
|
||||
VerifyTradeOTNick(data, t, nick, ot);
|
||||
}
|
||||
|
||||
private static void VerifyTradeOTNick(LegalityAnalysis data, EncounterTrade t, string nick, string OT)
|
||||
|
|
Loading…
Reference in a new issue