Skip to content

Commit

Permalink
Fix mix command mixing 0 items
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Mar 4, 2024
1 parent a08844e commit 6366cca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mahoji/commands/mix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,17 @@ export const mixCommand: OSBMahojiCommand = {
const maxCanDo = user.bankWithGP.fits(baseCost);
const maxCanMix = Math.floor(maxTripLength / timeToMixSingleItem);

if (!user.owns(requiredItems)) {
return `You don't have the required items for ${mixableItem.item.name}: ${requiredItems}.`;
}

if (!quantity) {
quantity = maxCanMix;
if (maxCanDo < quantity && maxCanDo !== 0) quantity = maxCanDo;
}

quantity = Math.max(1, quantity);

if (quantity * timeToMixSingleItem > maxTripLength)
return `${user.minionName} can't go on trips longer than ${formatDuration(
maxTripLength
Expand Down

0 comments on commit 6366cca

Please sign in to comment.