FusionBot v8.1.1 #112
Secludedly
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Updated & Enhanced Ditto Trade Command
v8.0.9
$dt <IVs> <Language> <Nature> <Shiny> <OT/TID/SID> <OriginGame>Ditto @ Destiny Knot
Level: 100
Shiny: Yes
Timid Nature
Language: Japanese
OT: Ditto
TID: 143319
SID: 2551
OTGender: Male
.IV_HP=31
.IV_ATK=31
.IV_DEF=31
.IV_SPA=31
.IV_SPD=31
.IV_SPE=31
EXAMPLES
$dt 31/0/31/31/31/31 Japanese Adamant Shiny Meep/221133/3333/Female Scarlet- CREATES: Ditto, 0 Atk IV, Japanese, Adamant Nature, Shiny, Custom trainer info added, from Scarlet.
$dt English Sword- CREATES: Ditto, Default 6IV, English, Default Timid Nature, Non-Shiny, Default Ditto/112233/1212/Male trainer info, from Sword.
$dt Adamant- CREATES: Ditto, everything default except the nature being Adamant, the bot will generate from the native game.
$dt(with no options attached)- CREATES: Ditto, everything default and from the native game, and it will be shiny.
Moved Battle-Ready & Events in Hub to Folders
v8.1.0
Will need to re-add the folder paths.
Fix Shiny Being Exponged by TID/SID Overwriting the PID/XOR with AutoOT.
v8.1.1
TryApplyEarlyAutoOT was silently stripping shiny status. There is a second place AutoOT runs that the first fix didn't touch: TryApplyEarlyAutoOT in TradeModule.cs. This is called right after the PKM is generated and before the trade is queued, so it can mutate the new shiny PKM generation back to non-shiny.
So basically...
pk.OriginalTrainerName = cachedTrainerDetails.OT;
pk.TrainerTID7 = (uint)cachedTrainerDetails.TID; // <-- TID16 changed here, which reset the shiny PID.
pk.TrainerSID7 = (uint)cachedTrainerDetails.SID; // <-- SID16 changed here, which reset the shiny PID.
Then after that...
if (pk.IsShiny) // <-- Checks IsShiny AFTER TID/SID change. No good.
{
var shinyXor = pk.ShinyXor; // <-- Same bug
pk.PID = (uint)((pk.TID16 ^ pk.SID16 ^ (pk.PID & 0xFFFF) ^ shinyXor) << 16) | (pk.PID & 0xFFFF);
}
So pk.IsShiny returns false, the recompute block is skipped, and the PKM keeps the new TID/SID but with a mismatched PID that's non-shiny. The legality check doesn't catch it because a non-shiny PKM with the user's OT/TID/SID is perfectly legal.
So my initial v8.0.8 commit was right about the diagnosis direction but only patched one of the two spots that needed it. The same bad pattern also exists in AutoLegalityWrapper.GetLegal, but there it's hidden because the downstream (set.Shiny && !pk.IsShiny) block immediately retries/forces shiny. TryApplyEarlyAutoOT has no fallback, so the bug is fully visible.
To fix it...
I captured the original shiny state before mutating.
var originalPk = pk.Clone();
bool wasShiny = originalPk.IsShiny; // <-- Was it shiny originally before passing the AutoOT?
uint origShinyXor = originalPk.ShinyXor; // <-- Yup, so let's grab a valid shiny XOR on the clone.
Now we pull from cache as we apply the trainer info...
pk.OriginalTrainerName = cachedTrainerDetails.OT;
pk.TrainerTID7 = (uint)cachedTrainerDetails.TID;
pk.TrainerSID7 = (uint)cachedTrainerDetails.SID;
Now we pass it through AutoOT with the properly and previously applied XOR for a shiny...
if (wasShiny)
pk.PID = (uint)((pk.TID16 ^ pk.SID16 ^ (pk.PID & 0xFFFF) ^ origShinyXor) << 16) | (pk.PID & 0xFFFF);
After refreshing the checksum, the Pokémon should be finalized as intended.
This discussion was created from the release FusionBot v8.1.1.
Beta Was this translation helpful? Give feedback.
All reactions