Skip to content

Skill Flag "AntiConsiderSwitching" does not work as intended for High & Best Skill Trainers #229

@Beebleborx

Description

@Beebleborx

(I found a bug detailed below. It may sound explanatory but my intent is to provide sufficient information for you to fix the bug, not to explain the code to you since I'm sure you know it much better than I.)

AI_ChooseMove lines 342-356 check if an AI is High (or Best) skill, then checks if they want to switch out due to terrible moves, and then if so, calls pbChooseToSwitchOut(true).

pbChooseToSwitchOut in AI_Switch takes true or false as input, and if no input is given, sets "terrible_moves" to false. Since it is given "true" when it is called in AI_ChooseMove, it sets "terrible_moves" to true.

Further down, pbChooseToSwitchOut/AI_Switch line 24 checks if "terrible_moves" is true or false. If true (which it is as established above), it logs a message in the debug log and skips over the "else" condition, which is where the "return false if [email protected]_skill_flag?("ConsiderSwitching")" line is.

In this manner, any trainer with skill >=48 would bypass the "AntiConsiderSwitching" check. I've resolved this in my game by moving the "return false if [email protected]_skill_flag?("ConsiderSwitching")" line up above the "if terrible_moves" check, but I'm not sure about the remainder of the else criteria that gets skipped for the High & Best skill AI's. Something to be looked into for the next hotfixes, or next version of Essentials perhaps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions