From 470d2bb54aef6c6b0c10d0b7b190d9ada476e357 Mon Sep 17 00:00:00 2001 From: Hubblenaut Date: Sun, 11 Oct 2015 22:02:05 +0200 Subject: [PATCH] Fixes stack creation logic and return value --- code/game/objects/items/stacks/stack.dm | 7 ++++--- code/modules/materials/material_sheets.dm | 5 +++-- code/modules/materials/materials.dm | 2 -- html/changelogs/Hubblenaut-master.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 2c3fc80a315..9a73ed0eec8 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -137,6 +137,7 @@ if (istype(O, /obj/item/stack)) var/obj/item/stack/S = O S.amount = produced + S.add_to_stacks(user) if (istype(O, /obj/item/weapon/storage)) //BubbleWrap - so newly formed boxes are empty for (var/obj/item/I in O) @@ -284,13 +285,13 @@ return return max_amount -/obj/item/stack/proc/add_to_stacks(mob/usr as mob) - for (var/obj/item/stack/item in usr.loc) +/obj/item/stack/proc/add_to_stacks(mob/user as mob) + for (var/obj/item/stack/item in user.loc) if (item==src) continue var/transfer = src.transfer_to(item) if (transfer) - usr << "You add a new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s." + user << "You add a new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s." if(!amount) break diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index fdb20ab1191..a4379cf871c 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -65,9 +65,10 @@ var/obj/item/stack/material/M = S if(!istype(M) || material.name != M.material.name) return 0 - ..(S,tamount,1) + var/transfer = ..(S,tamount,1) if(src) update_strings() if(M) M.update_strings() + return transfer /obj/item/stack/material/attack_self(var/mob/user) if(!material.build_windows(user, src)) @@ -207,4 +208,4 @@ desc = "This sheet is special platinum-glass alloy designed to withstand large temperatures. It is reinforced with few rods." singular_name = "reinforced borosilicate glass sheet" icon_state = "sheet-phoronrglass" - default_type = "reinforced borosilicate glass" \ No newline at end of file + default_type = "reinforced borosilicate glass" diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 71a669ab666..158c9ef8760 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -127,8 +127,6 @@ var/list/name_to_material var/obj/item/stack/S = new rod_product(get_turf(user)) S.add_fingerprint(user) S.add_to_stacks(user) - if(!(user.l_hand && user.r_hand)) - user.put_in_hands(S) /material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) if(!wire_product) diff --git a/html/changelogs/Hubblenaut-master.yml b/html/changelogs/Hubblenaut-master.yml index fca68d64515..10426fff707 100644 --- a/html/changelogs/Hubblenaut-master.yml +++ b/html/changelogs/Hubblenaut-master.yml @@ -33,5 +33,5 @@ delete-after: True # Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. # Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. changes: - - bugfix: "Welding a broken camera will use the correct icon." - - tweak: "Camera assemblies remember their tag and network from previous usage." + - bugfix: "Material stacks now properly merge upon creation." + - bugfix: "Messages for adding to existing stack appear again."