mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 14:37:27 +01:00
Merge pull request #420 from Hubblenaut/master
Fixes stack creation logic and return value
This commit is contained in:
@@ -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 << "<span class='notice'>You add a new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s.</span>"
|
||||
if(!amount)
|
||||
break
|
||||
|
||||
|
||||
@@ -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"
|
||||
default_type = "reinforced borosilicate glass"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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."
|
||||
Reference in New Issue
Block a user