Files
vgstation13/code/ATMOSPHERICS/components/unary/vent.dm
clusterfack 147c5bd5a7 A process scheduler thing
Included:
-The process lists use |= instead of += due to the increased stability of the former against double additions.

-Atmospherics machinery is moved under the pipenet processing.

-Modified the atmospherics processes to return 1 when theyve done something, and 0 if they aint done jack shit. Then called scheck() if they return 1, possibly  reducing unnecessary scheck calls while still managing to smooth out the atmospherics processing.

-If a powernet happens to get rebuilt by either powernets or power machinery scheck() is also called
2015-05-08 01:15:19 -05:00

81 lines
1.6 KiB
Plaintext

/obj/machinery/atmospherics/unary/vent
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
icon_state = "intact"
name = "Vent"
desc = "A large air vent"
level = 1
var/volume = 250
dir = SOUTH
initialize_directions = SOUTH
var/build_killswitch = 1
/obj/machinery/atmospherics/unary/vent/high_volume
name = "Larger vent"
volume = 1000
/obj/machinery/atmospherics/unary/vent/New()
..()
air_contents.volume=volume
/obj/machinery/atmospherics/unary/vent/process()
. = ..()
CHECK_DISABLED(vents)
if (!node)
return// Turning off the vent is a PITA. - N3X
// New GC does this sometimes
if(!loc) return
//air_contents.mingle_with_turf(loc)
var/datum/gas_mixture/removed = air_contents.remove(volume)
loc.assume_air(removed)
return 1
/obj/machinery/atmospherics/unary/vent/update_icon()
if(node)
icon_state = "intact"
//dir = get_dir(src, node)
else
icon_state = "exposed"
/obj/machinery/atmospherics/unary/vent/initialize()
..()
update_icon()
/obj/machinery/atmospherics/unary/vent/disconnect(obj/machinery/atmospherics/reference)
..()
update_icon()
/obj/machinery/atmospherics/unary/vent/hide(var/i)
if(node)
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
dir = get_dir(src, node)
else
icon_state = "exposed"
/obj/machinery/atmospherics/unary/vent/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
if(pipe)
dir = pipe.dir
initialize_directions = pipe.get_pipe_dir()
if (pipe.pipename)
name = pipe.pipename
else
initialize_directions = dir
var/turf/T = loc
level = T.intact ? 2 : 1
initialize()
build_network()
if (node)
node.initialize()
node.build_network()
return 1