From a6c856bd5f1e5f41a359f2cd83f829331f0fb1ea Mon Sep 17 00:00:00 2001 From: gc <30398469+gc@users.noreply.github.com> Date: Thu, 14 Mar 2024 00:36:42 +1100 Subject: [PATCH] Allow multiple crates per trip --- src/lib/util/handleTripFinish.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/util/handleTripFinish.ts b/src/lib/util/handleTripFinish.ts index e3296ff336..3842638900 100644 --- a/src/lib/util/handleTripFinish.ts +++ b/src/lib/util/handleTripFinish.ts @@ -316,14 +316,16 @@ const tripFinishEffects: TripFinishEffect[] = [ dropratePerMinute = Math.ceil(dropratePerMinute / 3); } const minutes = Math.floor(data.duration / Time.Minute); + const loot = new Bank(); for (let i = 0; i < minutes; i++) { if (roll(dropratePerMinute)) { - const loot = new Bank().add('Easter crate (s5)'); - await user.addItemsToBank({ items: loot, collectionLog: true }); - messages.push(bold(`You found ${loot}!`)); - break; + loot.add('Easter crate (s5)'); } } + if (loot.length > 0) { + await user.addItemsToBank({ items: loot, collectionLog: true }); + messages.push(bold(`You found ${loot}!`)); + } } }, {