Fix : sacrifice on discard not working
This commit is contained in:
@@ -258,7 +258,16 @@ export const tokenMappings = {
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
await gameService.destroyCard(card, player.board, game, session);
|
||||
if (player.discard.cards.some((c) => c._id.equals(card._id))) {
|
||||
await gameService.destroyCard(card, player.discard, game, session);
|
||||
} else if (player.board.cards.some((c) => c._id.equals(card._id))) {
|
||||
await gameService.destroyCard(card, player.board, game, session);
|
||||
} else {
|
||||
throw new HttpException(
|
||||
'Card not found in Discard or Board',
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
},
|
||||
[CardEffects.RESTACK_DISCARDED_CHAMPION]: async (
|
||||
game: Document<Game> & Game,
|
||||
|
||||
Reference in New Issue
Block a user