mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-05-06 22:17:05 -05:00
Suppress crash on move request with all actives fainted
There's a weird bug in which it's possible to open a choose-move screen when the client believes that all your active Pokemon are fainted (this is not true). It seems to involve having a team with multiple Pokemon with the same name, multiple Pokemon with the same species, and/or Illusion (in case it was unclear, this is a Hackmons-specific bug). I don't have time to look at it in depth, but this commit suppresses it enough to make PS playable instead of crashing in that situation.
This commit is contained in:
parent
a38adf728a
commit
24c07d3271
5361
js/battle-beta.js
Normal file
5361
js/battle-beta.js
Normal file
File diff suppressed because it is too large
Load Diff
14
js/battlescene.js
Normal file
14
js/battlescene.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* Battle Scene library
|
||||
* Pokemon Showdown - http://pokemonshowdown.com/
|
||||
*
|
||||
* @license GPLv2 <http://www.gnu.org/licenses/gpl-2.0.html>
|
||||
*/
|
||||
|
||||
function BattleScene {
|
||||
//
|
||||
}
|
||||
|
||||
function BattleSprite {
|
||||
//
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
choices: [],
|
||||
switchFlags: {}
|
||||
}
|
||||
while (switchables[this.choice.choices.length] && switchables[this.choice.choices.length].fainted) {
|
||||
if (this.choice.choices.length > 1) while (switchables[this.choice.choices.length] && switchables[this.choice.choices.length].fainted) {
|
||||
this.choice.choices.push('pass');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user