Merge pull request #3158 from Citadel-Station-13/upstream-merge-31298

[MIRROR] Fixes crafting stacks without breaking crafted machinery
This commit is contained in:
LetterJay
2017-10-06 02:11:45 -04:00
committed by GitHub

View File

@@ -151,7 +151,11 @@
if(!building_checks(R, multiplier))
return
var/obj/O = new R.result_type()
var/obj/O
if(R.max_res_amount > 1) //Is it a stack?
O = new R.result_type(usr.drop_location(), R.res_amount * multiplier)
else
O = new R.result_type(usr.drop_location())
O.setDir(usr.dir)
use(R.req_amount * multiplier)
@@ -164,16 +168,11 @@
W.ini_dir = W.dir
//END: oh fuck i'm so sorry
//is it a stack ?
if (R.max_res_amount > 1)
var/obj/item/stack/new_item = O
new_item.amount = R.res_amount*multiplier
new_item.update_icon()
if (QDELETED(O))
return //It's a stack and has already been merged
if (isitem(O))
usr.put_in_hands(O)
else
O.forceMove(usr.drop_location())
O.add_fingerprint(usr)
//BubbleWrap - so newly formed boxes are empty