diff --git a/NEWS b/NEWS index a98e7e4fd..8c42cd542 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ DFHack Future Lua scripts will only be reloaded if necessary and will delete their old globals if the file was changed. Fixes Gave add-thought a proper subthought arg. + Made hack-wish stack properly. New Plugins New Scripts modtools/reaction-product-trigger: triggers callbacks when products are produced (contrast with when reactions complete) 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