From 674b9dd5a9fe21655aab3056ff438bea65aa4e30 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Thu, 5 Feb 2015 00:25:05 -0800 Subject: [PATCH] Made hack-wish stack properly. --- scripts/gui/hack-wish.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/gui/hack-wish.lua b/scripts/gui/hack-wish.lua index f14f787f1..19e59bb52 100644 --- a/scripts/gui/hack-wish.lua +++ b/scripts/gui/hack-wish.lua @@ -190,8 +190,13 @@ function hackWish(unit) if args.multi then repeat amountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN) until tonumber(amount) if mattype and itemtype then - for i=1,tonumber(amount) do - createItem({mattype,matindex},{itemtype,itemsubtype},quality,unit,description) + if df.item_type.attrs[itemtype].is_stackable then + local proper_item=df.item.find(dfhack.items.createItem(itemtype, itemsubtype, mattype, matindex, unit)) + proper_item:setStackSize(amount) + else + for i=1,amount do + dfhack.items.createItem(itemtype, itemsubtype, mattype, matindex, unit) + end end end else