Skip to content

Commit 5bbd810

Browse files
Merge pull request #183 from DennisMartinez/master
Fixing "Make X" and "Make All" options
2 parents 4c478e1 + 3e35b1b commit 5bbd810

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/world/actor/player/action/item-selection-action.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Player } from '@server/world/actor/player/player';
22

33
const amounts = [
4-
1, 5, 10, 0
4+
1, 5, 'X', 'All'
55
];
66

77
const widgets = {
@@ -123,9 +123,9 @@ export async function itemSelectionAction(player: Player, type: 'COOKING' | 'MAK
123123
}
124124

125125
const itemId = items[choiceIndex].itemId;
126-
const amount = amounts[optionIndex];
126+
let amount = amounts[optionIndex];
127127

128-
if(amount === 0) {
128+
if(amount === 'X') {
129129
actionsSub.unsubscribe();
130130

131131
player.outgoingPackets.showNumberInputDialogue();
@@ -149,6 +149,10 @@ export async function itemSelectionAction(player: Player, type: 'COOKING' | 'MAK
149149
}
150150
});
151151
} else {
152+
if (amount === 'All') {
153+
amount = player.inventory.findAll(itemId).length;
154+
}
155+
152156
actionsSub.unsubscribe();
153157
interactionSub.unsubscribe();
154158
player.closeActiveWidgets();

0 commit comments

Comments
 (0)