From bce3e256cfa783ebd6354a43250f4acc617cfc9c Mon Sep 17 00:00:00 2001 From: zamlty <29914613+zamlty@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:21:39 +0800 Subject: [PATCH] Fix artifact & weapon generation by give command --- .../java/emu/grasscutter/command/commands/GiveCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java index 7d15a475..a533130b 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java @@ -95,18 +95,19 @@ public final class GiveCommand implements CommandHandler { } private void item(GenshinPlayer player, ItemData itemData, int amount) { - GenshinItem genshinItem = new GenshinItem(itemData); if (itemData.isEquip()) { List items = new LinkedList<>(); for (int i = 0; i < amount; i++) { - items.add(genshinItem); + items.add(new GenshinItem(itemData)); } player.getInventory().addItems(items); player.sendPacket(new PacketItemAddHintNotify(items, ActionReason.SubfieldDrop)); } else { + GenshinItem genshinItem = new GenshinItem(itemData); genshinItem.setCount(amount); player.getInventory().addItem(genshinItem); player.sendPacket(new PacketItemAddHintNotify(genshinItem, ActionReason.SubfieldDrop)); } } } +