fixed StealEatBerryAttr sometimes eating 2 stacks of a berry

pull/232/head
lucfd 2024-04-30 11:34:50 -04:00 committed by GitHub
parent 85edb32c06
commit 703b9303ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1189,7 +1189,7 @@ export class StealEatBerryAttr extends EatBerryAttr {
if (heldBerries.length) { if (heldBerries.length) {
this.chosenBerry = heldBerries[user.randSeedInt(heldBerries.length)]; this.chosenBerry = heldBerries[user.randSeedInt(heldBerries.length)];
if (!--this.chosenBerry.stackCount) if (this.chosenBerry.stackCount == 1)
target.scene.removeModifier(this.chosenBerry); target.scene.removeModifier(this.chosenBerry);
target.scene.updateModifiers(target.isPlayer()); target.scene.updateModifiers(target.isPlayer());