diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 75f4ec2f3c4..d8a62b693a9 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -195,6 +195,10 @@ var/send_feedback = 1 if(check_contents(a, R, contents)) if(check_tools(a, R, contents)) + if(R.one_per_turf) + for(var/content as anything in get_turf(a)) + if(istype(content, R.result)) + return ", object already present." //If we're a mob we'll try a do_after; non mobs will instead instantly construct the item if(ismob(a) && !do_after(a, R.time, target = a)) return "." diff --git a/code/datums/components/crafting/recipes.dm b/code/datums/components/crafting/recipes.dm index 80216c7e1aa..8dcf1ca4166 100644 --- a/code/datums/components/crafting/recipes.dm +++ b/code/datums/components/crafting/recipes.dm @@ -22,6 +22,8 @@ var/additional_req_text ///Required machines for the craft, set the assigned value of the typepath to CRAFTING_MACHINERY_CONSUME or CRAFTING_MACHINERY_USE. Lazy associative list: type_path key -> flag value. var/list/machinery + ///Should only one object exist on the same turf? + var/one_per_turf = FALSE /datum/crafting_recipe/New() if(!(result in reqs)) @@ -1165,6 +1167,7 @@ tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_MULTITOOL, TOOL_WIRECUTTER, TOOL_WELDER) time = 15 SECONDS category = CAT_MISC + one_per_turf = TRUE /datum/crafting_recipe/blast_doors name = "Blast Door" @@ -1176,6 +1179,7 @@ tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_MULTITOOL, TOOL_WIRECUTTER, TOOL_WELDER) time = 30 SECONDS category = CAT_MISC + one_per_turf = TRUE /datum/crafting_recipe/aquarium name = "Aquarium"