Made hack-wish stack properly.

develop
Putnam3145 2015-02-05 00:25:05 -08:00
parent bcfff161e7
commit 674b9dd5a9
1 changed files with 7 additions and 2 deletions

@ -190,8 +190,13 @@ function hackWish(unit)
if args.multi then if args.multi then
repeat amountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN) until tonumber(amount) repeat amountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN) until tonumber(amount)
if mattype and itemtype then if mattype and itemtype then
for i=1,tonumber(amount) do if df.item_type.attrs[itemtype].is_stackable then
createItem({mattype,matindex},{itemtype,itemsubtype},quality,unit,description) 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
end end
else else