5180 fichiers 38.5 Mo 0 téléchargements 224 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / inventory / TradeQuantity.ts
TradeQuantity.ts 618 o Télécharger le fichier
/**
 * How many of a stack to offer: the typed amount, held between one and what is still unlocked. An
 * empty or unreadable field (NaN), zero or a negative amount offers nothing. The view used to offer the
 * raw field, and GroupItem.getTradeItems compared `found >= NaN`, which is never true, so clearing the
 * field to retype it offered the whole stack.
 */
export const clampTradeQuantity = (value: number, available: number): number => {
    if (!Number.isFinite(value) || value <= 0 || !Number.isFinite(available) || available <= 0) return 0;

    return Math.min(Math.floor(value), Math.floor(available));
};
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser