From acf6256c3065ef7e4c055b09ccf6b2ff85fca62f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:29:05 +0200 Subject: [PATCH] [MIRROR] Makes applies_mats on stack crafting work if the recipe result is a turf [MDB IGNORE] (#20397) * Makes applies_mats on stack crafting work if the recipe result is a turf (#74553) ## About The Pull Request This doesn't happen anywhere, but I found out this didn't work when working on something stupid the other day. I figured I'd fix it here while I'm at it. ## Why It's Good For The Game If someone wants to make a turf created directly by stack crafting for whatever reason, it should at least get materials applied if its wanted. ## Changelog :cl: fix: Turfs made through stack crafting (so none currently) will have materials applied if the var is set /:cl: * Makes applies_mats on stack crafting work if the recipe result is a turf --------- Co-authored-by: Paxilmaniac <82386923+Paxilmaniac@users.noreply.github.com> --- code/game/objects/items/stacks/stack.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 6a0ff3e6718..58565820bbe 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -390,8 +390,10 @@ var/turf/covered_turf = builder.drop_location() if(!isturf(covered_turf)) return - covered_turf.PlaceOnTop(recipe.result_type, flags = CHANGETURF_INHERIT_AIR) + var/turf/created_turf = covered_turf.PlaceOnTop(recipe.result_type, flags = CHANGETURF_INHERIT_AIR) builder.balloon_alert(builder, "placed [ispath(recipe.result_type, /turf/open) ? "floor" : "wall"]") + if(recipe.applies_mats && LAZYLEN(mats_per_unit)) + created_turf.set_custom_materials(mats_per_unit, recipe.req_amount / recipe.res_amount) else created = new recipe.result_type(builder.drop_location())