diff --git a/SysBot.Pokemon/BDSP/BotTrade/PokeTradeBotBS.cs b/SysBot.Pokemon/BDSP/BotTrade/PokeTradeBotBS.cs index 5f8de9926..70bc8311a 100644 --- a/SysBot.Pokemon/BDSP/BotTrade/PokeTradeBotBS.cs +++ b/SysBot.Pokemon/BDSP/BotTrade/PokeTradeBotBS.cs @@ -850,8 +850,8 @@ private static void UpdateTrainerDetails(PB8 pokemon, PB8 offered, string tradeP if (actualLength < maxLength) { - trash[actualLength * 2] = 0xFF; - trash[actualLength * 2 + 1] = 0xFF; + trash[actualLength * 2] = 0x00; + trash[actualLength * 2 + 1] = 0x00; } } diff --git a/SysBot.Pokemon/LA/BotTrade/PokeTradeBotLA.cs b/SysBot.Pokemon/LA/BotTrade/PokeTradeBotLA.cs index f10d853c4..50da8ecfb 100644 --- a/SysBot.Pokemon/LA/BotTrade/PokeTradeBotLA.cs +++ b/SysBot.Pokemon/LA/BotTrade/PokeTradeBotLA.cs @@ -877,8 +877,8 @@ private static void UpdateTrainerDetails(PA8 pokemon, TradePartnerLA tradePartne if (actualLength < maxLength) { - trash[actualLength * 2] = 0xFF; - trash[actualLength * 2 + 1] = 0xFF; + trash[actualLength * 2] = 0x00; + trash[actualLength * 2 + 1] = 0x00; } } } diff --git a/SysBot.Pokemon/SV/BotTrade/PokeTradeBotSV.cs b/SysBot.Pokemon/SV/BotTrade/PokeTradeBotSV.cs index 9c887371b..ccd4a24a8 100644 --- a/SysBot.Pokemon/SV/BotTrade/PokeTradeBotSV.cs +++ b/SysBot.Pokemon/SV/BotTrade/PokeTradeBotSV.cs @@ -1347,7 +1347,17 @@ private async Task SetBoxPkmWithSwappedIDDetailsSV(PK9 toSend, TradeMyStat UpdateTrainerDetails(cln, tradePartner); cln.Version = DetermineVersion(cln.Species, cln.Form, tradePartner); ClearNicknameIfNeeded(cln); - UpdateShininess(cln); + if (toSend.MetLocation == Locations.TeraCavern9 && toSend.IsShiny) + { + uint id32 = (uint)((cln.TID16) | (cln.SID16 << 16)); + uint pid = cln.PID; + ShinyUtil.ForceShinyState(true, ref pid, id32, 1u); + cln.PID = pid; + } + else if (toSend.IsShiny) + { + cln.SetShiny(); + } cln.RefreshChecksum(); var tradeSV = new LegalityAnalysis(cln); if (tradeSV.Valid) @@ -1369,25 +1379,21 @@ private static void UpdateTrainerDetails(PK9 pokemon, TradeMyStatus tradePartner pokemon.TrainerTID7 = (uint)Math.Abs(tradePartner.DisplayTID); pokemon.TrainerSID7 = (uint)Math.Abs(tradePartner.DisplaySID); pokemon.Language = tradePartner.Language; - Span trash = pokemon.OriginalTrainerTrash; trash.Clear(); - string name = tradePartner.OT; - int maxLength = trash.Length / 2; + int maxLength = trash.Length / 2; int actualLength = Math.Min(name.Length, maxLength); - for (int i = 0; i < actualLength; i++) { char value = name[i]; trash[i * 2] = (byte)value; trash[i * 2 + 1] = (byte)(value >> 8); } - if (actualLength < maxLength) { - trash[actualLength * 2] = 0xFF; - trash[actualLength * 2 + 1] = 0xFF; + trash[actualLength * 2] = 0x00; + trash[actualLength * 2 + 1] = 0x00; } } @@ -1470,15 +1476,4 @@ private static void ClearNicknameIfNeeded(PK9 pokemon) if (!pokemon.IsNicknamed) pokemon.ClearNickname(); } - - private static void UpdateShininess(PK9 pokemon) - { - if (pokemon.IsShiny) - { - uint id32 = (uint)((pokemon.TID16) | (pokemon.SID16 << 16)); - uint pid = pokemon.PID; - ShinyUtil.ForceShinyState(true, ref pid, id32, 1u); - pokemon.PID = pid; - } - } } diff --git a/SysBot.Pokemon/SWSH/BotTrade/PokeTradeBotSWSH.cs b/SysBot.Pokemon/SWSH/BotTrade/PokeTradeBotSWSH.cs index 786769716..3a26a190b 100644 --- a/SysBot.Pokemon/SWSH/BotTrade/PokeTradeBotSWSH.cs +++ b/SysBot.Pokemon/SWSH/BotTrade/PokeTradeBotSWSH.cs @@ -1159,8 +1159,8 @@ private static void UpdateTrainerDetails(PK8 pokemon, byte[] data, string traine if (actualLength < maxLength) { - trash[actualLength * 2] = 0xFF; - trash[actualLength * 2 + 1] = 0xFF; + trash[actualLength * 2] = 0x00; + trash[actualLength * 2 + 1] = 0x00; } } }