Skip to content

Commit

Permalink
fix slamingo item duplication bug (#2535)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpolletvillard authored Dec 6, 2024
1 parent d3080ba commit 92d9b3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/rooms/commands/game-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ export class OnDragDropCommand extends Command<
if (dropOnBench) {
// From board to bench is always allowed (bench to bench is already handled)
this.room.swap(player, pokemon, x, y)
pokemon.onChangePosition(x, y, player)
success = true
if (this.state.specialGameRule === SpecialGameRule.SLAMINGO) {
pokemon.items.forEach((item) => {
player.items.push(item)
pokemon.removeItem(item)
})
}
pokemon.onChangePosition(x, y, player)
success = true
} else if (
pokemon.canBePlaced &&
!(dropFromBench && dropToEmptyPlace && isBoardFull)
Expand Down

0 comments on commit 92d9b3c

Please sign in to comment.