mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Update pipe_dispenser.dm
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user