mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fixes stack creation logic and return value
This commit is contained in:
@@ -137,6 +137,7 @@
|
|||||||
if (istype(O, /obj/item/stack))
|
if (istype(O, /obj/item/stack))
|
||||||
var/obj/item/stack/S = O
|
var/obj/item/stack/S = O
|
||||||
S.amount = produced
|
S.amount = produced
|
||||||
|
S.add_to_stacks(user)
|
||||||
|
|
||||||
if (istype(O, /obj/item/weapon/storage)) //BubbleWrap - so newly formed boxes are empty
|
if (istype(O, /obj/item/weapon/storage)) //BubbleWrap - so newly formed boxes are empty
|
||||||
for (var/obj/item/I in O)
|
for (var/obj/item/I in O)
|
||||||
@@ -284,13 +285,13 @@
|
|||||||
return
|
return
|
||||||
return max_amount
|
return max_amount
|
||||||
|
|
||||||
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
|
/obj/item/stack/proc/add_to_stacks(mob/user as mob)
|
||||||
for (var/obj/item/stack/item in usr.loc)
|
for (var/obj/item/stack/item in user.loc)
|
||||||
if (item==src)
|
if (item==src)
|
||||||
continue
|
continue
|
||||||
var/transfer = src.transfer_to(item)
|
var/transfer = src.transfer_to(item)
|
||||||
if (transfer)
|
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)
|
if(!amount)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
/obj/item/stack/material/proc/update_strings()
|
/obj/item/stack/material/proc/update_strings()
|
||||||
// Update from material datum.
|
// Update from material datum.
|
||||||
singular_name = material.sheet_singular_name
|
singular_name = material.sheet_singular_name
|
||||||
|
|
||||||
if(amount>1)
|
if(amount>1)
|
||||||
name = "[material.use_name] [material.sheet_plural_name]"
|
name = "[material.use_name] [material.sheet_plural_name]"
|
||||||
desc = "A stack of [material.use_name] [material.sheet_plural_name]."
|
desc = "A stack of [material.use_name] [material.sheet_plural_name]."
|
||||||
@@ -64,9 +64,10 @@
|
|||||||
var/obj/item/stack/material/M = S
|
var/obj/item/stack/material/M = S
|
||||||
if(!istype(M) || material.name != M.material.name)
|
if(!istype(M) || material.name != M.material.name)
|
||||||
return 0
|
return 0
|
||||||
..(S,tamount,1)
|
var/transfer = ..(S,tamount,1)
|
||||||
if(src) update_strings()
|
if(src) update_strings()
|
||||||
if(M) M.update_strings()
|
if(M) M.update_strings()
|
||||||
|
return transfer
|
||||||
|
|
||||||
/obj/item/stack/material/attack_self(var/mob/user)
|
/obj/item/stack/material/attack_self(var/mob/user)
|
||||||
if(!material.build_windows(user, src))
|
if(!material.build_windows(user, src))
|
||||||
|
|||||||
@@ -128,8 +128,6 @@ var/list/name_to_material
|
|||||||
var/obj/item/stack/S = new rod_product(get_turf(user))
|
var/obj/item/stack/S = new rod_product(get_turf(user))
|
||||||
S.add_fingerprint(user)
|
S.add_fingerprint(user)
|
||||||
S.add_to_stacks(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)
|
/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
|
||||||
if(!wire_product)
|
if(!wire_product)
|
||||||
|
|||||||
37
html/changelogs/Hubblenaut-master.yml
Normal file
37
html/changelogs/Hubblenaut-master.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: Hubblenaut
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# 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: "Material stacks now properly merge upon creation."
|
||||||
|
- bugfix: "Messages for adding to existing stack appear again."
|
||||||
Reference in New Issue
Block a user