diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 6e7ffddeb3..7cef6094ea 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -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