From 674b9dd5a9fe21655aab3056ff438bea65aa4e30 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Thu, 5 Feb 2015 00:25:05 -0800 Subject: [PATCH 1/2] 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 From 2b438a297056beef04cc1eb1b53d3e78d79a7903 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Thu, 5 Feb 2015 00:26:33 -0800 Subject: [PATCH 2/2] Update NEWS --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 27d31d532..4b975acf8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ DFHack Future Internals Lua scripts will only be reloaded if necessary and will delete their old globals if the file was changed. Fixes + Made hack-wish stack properly. New Plugins New Scripts modtools/reaction-product-trigger: triggers callbacks when products are produced (contrast with when reactions complete)