From b46c9ca7367408bed268d3dee0e32316afad74dc Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Wed, 1 Feb 2023 14:21:13 -0500 Subject: [PATCH] added use of bugfix define --- Fix-AI's-Switch-In-Battle.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Fix-AI's-Switch-In-Battle.md b/Fix-AI's-Switch-In-Battle.md index 4dab9ae..025a0ca 100644 --- a/Fix-AI's-Switch-In-Battle.md +++ b/Fix-AI's-Switch-In-Battle.md @@ -25,8 +25,11 @@ The change below makes it so we check if Pokemon that have super effective typin while (invalidMons != 0x3F) // All mons are invalid. { -- bestDmg = TYPE_MUL_NO_EFFECT; ++#ifdef BUGFIX + bestDmg = 255; ++#else + bestDmg = TYPE_MUL_NO_EFFECT; ++#endif bestMonId = PARTY_SIZE; // Find the mon whose type is the most suitable offensively. @@ -37,8 +40,11 @@ The change below makes it so we check if Pokemon that have super effective typin /* Possible bug: this comparison gives the type that takes the most damage, when a "good" AI would want to select the type that takes the least damage. Unknown if this is a legitimate mistake or if it's an intentional, if weird, design choice */ -- if (bestDmg < typeDmg) ++#ifdef BUGFIX + if (bestDmg > typeDmg) ++#else + if (bestDmg < typeDmg) ++#endif { bestDmg = typeDmg; bestMonId = i;