Prevents pipe dispensers from spawning things that should not be (#38470)

* I have famined for too long without oats

* you must deliver to me your oats
This commit is contained in:
vuonojenmustaturska
2018-06-14 09:08:40 +03:00
committed by yogstation13-bot
parent af9903287b
commit 69b6a7ff8f

View File

@@ -42,6 +42,8 @@
if(href_list["makepipe"])
if(wait < world.time)
var/p_type = text2path(href_list["makepipe"])
if (!verify_recipe(GLOB.atmos_pipe_recipes, p_type))
return
var/p_dir = text2num(href_list["dir"])
var/obj/item/pipe/P = new (loc, p_type, p_dir)
P.setPipingLayer(piping_layer)
@@ -66,6 +68,15 @@
else
return ..()
/obj/machinery/pipedispenser/proc/verify_recipe(recipes, path)
for(var/category in recipes)
var/list/cat_recipes = recipes[category]
for(var/i in cat_recipes)
var/datum/pipe_info/info = i
if (path == info.id)
return TRUE
return FALSE
/obj/machinery/pipedispenser/wrench_act(mob/living/user, obj/item/I)
if(default_unfasten_wrench(user, I, 40))
user << browse(null, "window=pipedispenser")
@@ -124,6 +135,8 @@
if(href_list["dmake"])
if(wait < world.time)
var/p_type = text2path(href_list["dmake"])
if (!verify_recipe(GLOB.disposal_pipe_recipes, p_type))
return
var/obj/structure/disposalconstruct/C = new (loc, p_type)
if(!C.can_place())