Skip to content

Commit e7b0d7f

Browse files
committed
Bug fixes
Fixed `Patch Colored Text Crashes` for XY and fixed cheats that involved selecting Moves or Pokémon
1 parent 12dd1b0 commit e7b0d7f

File tree

3 files changed

+72
-34
lines changed

3 files changed

+72
-34
lines changed

Includes/Helpers/Lookup.hpp

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,7 +2932,7 @@ namespace CTRPluginFramework {
29322932
{10, "Timer Ball", 3}
29332933
};
29342934

2935-
static const char *allMoves[675] = {
2935+
static const char *allMoves[728] = {
29362936
"Pound",
29372937
"Karate Chop",
29382938
"Double Slap",
@@ -3554,6 +3554,43 @@ namespace CTRPluginFramework {
35543554
"Precipice Blades",
35553555
"Dragon Ascent",
35563556
"Hyperspace Fury",
3557+
"Breakneck Blitz P",
3558+
"Breakneck Blitz S",
3559+
"All Out Pummeling P",
3560+
"All Out Pummeling S",
3561+
"Supersonic Skystrike P",
3562+
"Supersonic Skystrike S",
3563+
"Acid Downpour P",
3564+
"Acid Downpour S",
3565+
"Tectonic Rage P",
3566+
"Tectonic Rage S",
3567+
"Continental Crush P",
3568+
"Continental Crush S",
3569+
"Savage Spin Out P",
3570+
"Savage Spin Out S",
3571+
"Never Ending Nightmare P",
3572+
"Never Ending Nightmare S",
3573+
"Corkscrew Crash P",
3574+
"Corkscrew Crash S",
3575+
"Inferno Overdrive P",
3576+
"Inferno Overdrive S",
3577+
"Hydro Vortex P",
3578+
"Hydro Vortex S",
3579+
"Bloom Doom P",
3580+
"Bloom Doom S",
3581+
"Gigavolt Havoc P",
3582+
"Gigavolt Havoc S",
3583+
"Shattered Psyche P",
3584+
"Shattered Psyche S",
3585+
"Subzero Slammer P",
3586+
"Subzero Slammer S",
3587+
"Devastating Drake P",
3588+
"Devastating Drake S",
3589+
"Black Hole Eclipse P",
3590+
"Black Hole Eclipse S",
3591+
"Twinkle Tackle P",
3592+
"Twinkle Tackle S",
3593+
"Catastropika",
35573594
"Shore Up",
35583595
"First Impression",
35593596
"Baneful Bunker",
@@ -3590,6 +3627,15 @@ namespace CTRPluginFramework {
35903627
"Dragon Hammer",
35913628
"Brutal Swing",
35923629
"Aurora Veil",
3630+
"Sinister Arrow Raid",
3631+
"Malicious Moonsault",
3632+
"Oceanic Operetta",
3633+
"Guardian of Alola",
3634+
"Soul Stealing 7 Star Strike",
3635+
"Stoked Sparksurfer",
3636+
"Pulverizing Pancake",
3637+
"Extreme Evoboost",
3638+
"Genesis Supernova",
35933639
"Shell Trap",
35943640
"Fleur Cannon",
35953641
"Psychic Fangs",
@@ -3603,11 +3649,18 @@ namespace CTRPluginFramework {
36033649
"Moongeist Beam",
36043650
"Tearful Look",
36053651
"Zing Zap",
3606-
"Nature's Madness",
3607-
"Multi-Attack",
3652+
"Natures Madness",
3653+
"Multi Attack",
3654+
"Ten M Volt Thunderbolt",
36083655
"Mind Blown",
36093656
"Plasma Fists",
3610-
"Photon Geyser"
3657+
"Photon Geyser",
3658+
"Light That Burns the Sky",
3659+
"Searing Sunraze Smash",
3660+
"Menacing Moonraze Maelstrom",
3661+
"Lets Snuggle Forever",
3662+
"Splintered Stormshards",
3663+
"Clangorous Soulblaze"
36113664
};
36123665

36133666
extern int moveID;

Sources/Folders/Miscellaneous.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ namespace Misc {
278278
ProcessPlus process;
279279
unsigned int x = stoul(process.Address(s, -5), nullptr, 16);
280280

281-
if (!ProcessPlus::Write32(x, 0xE3B01000, original, entry, saved))
281+
if (!ProcessPlus::Write32(x + Helpers::GetVersion(Helpers::PickGame(0x2000, 0), 0), 0xE3B01000, original, entry, saved))
282282
return;
283283
}
284284
}

Sources/Helpers/Lookup.cpp

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CTRPluginFramework {
66
u16 spwnSpecies;
77
u8 spawnLv;
88
u8 spwnForm;
9-
int pkmnID;
9+
int pkmnID = 0;
1010

1111
int MatchPkmn(Pokemon &output, string &input) {
1212
int index = 0;
@@ -67,26 +67,22 @@ namespace CTRPluginFramework {
6767
// If we have only one matches, complete the input
6868
if (count == 1) {
6969
pkmnID = matches.choiceNo[0] + 1;
70-
input = matches.name[0];
71-
return;
72-
}
73-
74-
if (count == 2 && (input == "Mew" || input == "Pidgeot")) {
75-
pkmnID = matches.choiceNo[1] + 1;
76-
input = matches.name[1];
70+
OSD::Notify(Color::LimeGreen << "Success" << Color::White << "! Selected: " << matches.name[0]);
71+
keyboard.Close();
7772
return;
7873
}
7974

8075
// If we have less than or equal to ten matches, populate a list keyboard
81-
if (count > 1 && count <= 10 && (input != "Mew" && input != "Pidgeot")) {
76+
if (count > 1 && count <= 10) {
8277
Keyboard kb(matches.name);
8378
kb.CanAbort(false);
8479
kb.DisplayTopScreen = false;
8580
choice = kb.Open();
8681

8782
if (choice >= 0) {
8883
pkmnID = matches.choiceNo[choice] + 1;
89-
input = matches.name[choice];
84+
OSD::Notify(Color::LimeGreen << "Success" << Color::White << "! Selected: " << matches.name[choice]);
85+
keyboard.Close();
9086
return;
9187
}
9288
}
@@ -100,8 +96,6 @@ namespace CTRPluginFramework {
10096

10197
if (KB<string>("Pokémon:", true, 11, output, "", PkmnInputChange))
10298
return;
103-
104-
pkmnID = 0;
10599
}
106100

107101
int abilityID;
@@ -297,7 +291,6 @@ namespace CTRPluginFramework {
297291
int index = 0;
298292
output.name.clear();
299293
string lowerCase(input);
300-
static const vector<int> ignored = {622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 695, 696, 697, 698, 699, 700, 701, 702, 703, 719, 723, 724, 725, 726, 727, 728};
301294

302295
for (char &character : lowerCase)
303296
character = tolower(character);
@@ -314,11 +307,9 @@ namespace CTRPluginFramework {
314307
}
315308

316309
if (index < Helpers::AutoRegion(Helpers::GetVersion(617, 621), Helpers::GetVersion(719, 728))) {
317-
if (*find(ignored.begin(), ignored.end(), index) != index) {
318-
if (iterator == lowerCase.end()) {
319-
output.name.push_back(moves);
320-
output.choiceNo.push_back(index);
321-
}
310+
if (iterator == lowerCase.end()) {
311+
output.name.push_back(moves);
312+
output.choiceNo.push_back(index);
322313
}
323314
}
324315

@@ -355,26 +346,22 @@ namespace CTRPluginFramework {
355346
// If we have only one matches, complete the input
356347
if (count == 1) {
357348
moveID = matches.choiceNo[0] + 1;
358-
input = matches.name[0];
359-
return;
360-
}
361-
362-
if (count == 6 && (input == "Thunder")) {
363-
moveID = matches.choiceNo[4] + 1;
364-
input = matches.name[4];
349+
OSD::Notify(Color::LimeGreen << "Success" << Color::White << "! Applied: " << matches.name[0]);
350+
keyboard.Close();
365351
return;
366352
}
367353

368354
// If we have less than or equal to ten matches, populate a list keyboard
369-
if (count > 1 && count <= 10 && (input != "Thunder")) {
355+
if (count > 1 && count <= 10) {
370356
Keyboard kb(matches.name);
371357
kb.CanAbort(false);
372358
kb.DisplayTopScreen = false;
373359
int choice = kb.Open();
374360

375361
if (choice >= 0) {
376362
moveID = matches.choiceNo[choice] + 1;
377-
input = matches.name[choice];
363+
OSD::Notify(Color::LimeGreen << "Success" << Color::White << "! Applied: " << matches.name[choice]);
364+
keyboard.Close();
378365
return;
379366
}
380367
}
@@ -388,7 +375,5 @@ namespace CTRPluginFramework {
388375

389376
if (KB<string>("Move:", true, 27, output, "", MoveInputChange))
390377
return;
391-
392-
moveID = 0;
393378
}
394379
}

0 commit comments

Comments
 (0)