Prevent multiple pokeball throws: add throwing guard flag and block at 0 pokeballs

This commit is contained in:
Sterling Archer
2026-05-28 13:27:37 -07:00
parent 2c88aa2a5b
commit ddf96d87ac
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -1455,6 +1455,7 @@ class Game {
showCatchScreen() {
const wild = this.state.currentWild;
if (!wild) return;
this._throwing = false;
this.show('catch');
this._showController(true);
@@ -1496,6 +1497,9 @@ class Game {
}
throwPokeball(wild, canCatch) {
if (this._throwing) return;
if (this.state.pokeballs <= 0) return;
this._throwing = true;
this.state.pokeballs--;
SFX.pokeball();
@@ -1563,6 +1567,7 @@ class Game {
}
_showCatchResult(wild, canCatch) {
this._throwing = false;
this.show('catch-result');
this._showController(true);