mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user