Fix stack merge & return lost code (#26483)

* Fix stack merge & return lost code

* What is `S` and `O`?

* Comment

* Update code/game/objects/items/stacks/stack_recipe.dm

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Aylong
2024-08-13 01:24:49 +00:00
committed by GitHub
co-authored by Burzah
parent e61b21d7d1
commit e1ce7b9572
2 changed files with 45 additions and 37 deletions
+11 -4
View File
@@ -139,8 +139,9 @@
ui_interact(user)
/obj/item/stack/attackby(obj/item/thing, mob/user, params)
if((parent_stack && !istype(thing, merge_type)) || !(parent_stack && thing.type == type))
return ..()
if((parent_stack && !istype(thing, merge_type)) || (parent_stack && thing.type != type))
..()
return
var/obj/item/stack/material = thing
merge(material)
@@ -215,9 +216,15 @@
var/datum/stack_recipe/recipe = locateUID(params["recipe_uid"])
var/multiplier = text2num(params["multiplier"])
if(!recipe.try_build(user, material, multiplier))
return
return recipe.do_build(user, material, multiplier)
return FALSE
var/obj/result
result = recipe.do_build(user, material, multiplier, result)
if(!result)
return FALSE
recipe.post_build(user, material, result)
return TRUE
/**
* Recursively builds the recipes data for the given list of recipes, iterating through each recipe.