mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-11 18:55:38 -05:00
Improve autochoose comment per @Slayer95
This commit is contained in:
committed by
Slayer95
parent
e61965eaf5
commit
22b07d4ae6
@@ -28,7 +28,11 @@ export class RandomPlayerAI extends BattlePlayer {
|
||||
|
||||
receiveError(error: Error) {
|
||||
if (!error.message.startsWith('[Invalid choice]')) throw error;
|
||||
// Somehow we had a choice error - just let the simulator autochoose for us.
|
||||
// If we made an invalid choice we just let the simulator auto-choose for us. This can happen
|
||||
// if we were disabled (Imprison) or trapped (Arena Trap / Magnet Pull / Shadow Tag) and it
|
||||
// wasn't revealed to us until we made our choice. We could add extra logic to redo the decision,
|
||||
// removing the invalid choice from our set of options, but given how niche this edge case is
|
||||
// its not worth dramatically complicating the code to handle it.
|
||||
this.choose(`default`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user