From 408f4d1ac27cf426e8682753e7cd6ef1d200b345 Mon Sep 17 00:00:00 2001 From: DayV Date: Mon, 25 Nov 2024 13:29:03 +0000 Subject: [PATCH] init --- src/mahoji/commands/clue.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/mahoji/commands/clue.ts b/src/mahoji/commands/clue.ts index 0ec75380739..6a4d9501545 100644 --- a/src/mahoji/commands/clue.ts +++ b/src/mahoji/commands/clue.ts @@ -347,16 +347,7 @@ export const clueCommand: OSBMahojiCommand = { } } let quantity = clamp(user.bank.amount(clueTier.scrollID), 1, Math.floor(maxTripLength / timePerClue)); - - const duration = timePerClue * quantity; const maxCanDo = Math.floor(maxTripLength / timePerClue); - - if (duration > maxTripLength || quantity > maxCanDo) { - return `${user.minionName} can't go on Clue trips longer than ${formatDuration( - maxTripLength - )}, try a lower quantity. The highest amount you can do for ${clueTier.name} is ${maxCanDo}.`; - } - const response: Awaited = {}; let implingLootString = ''; @@ -412,6 +403,13 @@ export const clueCommand: OSBMahojiCommand = { } from ${openedImplings}x ${clueImpling.name}s.`; } + const duration = timePerClue * quantity; + if (duration > maxTripLength || quantity > maxCanDo) { + return `${user.minionName} can't go on Clue trips longer than ${formatDuration( + maxTripLength + )}, try a lower quantity. The highest amount you can do for ${clueTier.name} is ${maxCanDo}.`; + } + await addSubTaskToActivityTask({ ci: clueTier.id, implingID: clueImpling ? clueImpling.id : undefined,