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;