Merge branch 'main' into develop
All checks were successful
Deploy To Stage / build (push) Successful in 55s
Deploy To Stage / deploy (push) Successful in 16s

This commit is contained in:
Ethan Lane 2025-05-28 18:19:21 +01:00
commit 334be26326
3 changed files with 6 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{
"name": "card-drop",
"version": "0.9.1",
"version": "0.9.2",
"main": "./dist/bot.js",
"typings": "./dist",
"scripts": {

View file

@ -39,12 +39,11 @@ export default class GetUnclaimedCardsHelper {
const allCards = CoreClient.Cards
.flatMap(x => x.cards)
.filter(x => x.type == rarity)
.filter(x => !claimedCards.find(y => y.CardNumber == x.id));
.filter(x => !claimedCards.find(y => y.CardNumber == x.id && y.Quantity > 0));
if (!allCards) {
AppLogger.LogError("CardDropHelperMetadata/GetRandomCardByRarityUnclaimed", `No cards found to randomise from, User Id: ${userId}, rarity: ${rarity}`);
return undefined;
if (!allCards || allCards.length == 0) {
// There is no card left unclaimed, fallback to any card
return GetCardsHelper.GetRandomCardByRarity(rarity);
};
const randomCardIndex = Math.floor(Math.random() * allCards.length);

View file

@ -151,7 +151,7 @@ export default class EffectHelper {
AppLogger.LogInfo("EffectHelper", `Created initial user entity for : ${userId}`);
}
if (user.Currency < totalCost) {
if (!disabled && user.Currency < totalCost) {
return `You don't have enough currency to buy this! You have \`${user.Currency} Currency\` and need \`${totalCost} Currency\`!`;
}