mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Ventcrawling fixes
d3athrow/vgstation13#4251 tgstation/-tg-station#9296 - Fixes moving between pipeline datums not updating pipe vision - Fixes login() not updating pipe vision - Removes hardcoded limit of entering through unary machinery-- does nothing *now* - Can see pipes in darkness as fullbright - More sanity checks
This commit is contained in:
@@ -25,12 +25,16 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
|
||||
var/image/pipe_image
|
||||
|
||||
var/global/datum/pipe_icon_manager/icon_manager
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(var/mob/living/M in src) //ventcrawling is serious business
|
||||
M.remove_ventcrawl()
|
||||
M.loc = src.loc
|
||||
M.forceMove(src.loc)
|
||||
if(pipe_image)
|
||||
del(pipe_image) //we have to del it, or it might keep a ref somewhere else
|
||||
..()
|
||||
|
||||
// Find a connecting /obj/machinery/atmospherics in specified direction.
|
||||
@@ -163,6 +167,9 @@ obj/machinery/atmospherics/proc/check_connect_types_construction(obj/machinery/a
|
||||
user.forceMove(target_move.loc) //handles entering and so on
|
||||
user.visible_message("You hear something squeezing through the ducts.", "You climb out the ventilation system.")
|
||||
else if(target_move.can_crawl_through())
|
||||
if(target_move.return_network(target_move) != return_network(src))
|
||||
user.remove_ventcrawl()
|
||||
user.add_ventcrawl(target_move)
|
||||
user.loc = target_move
|
||||
user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node)
|
||||
if(reference == node || reference == src)
|
||||
return network
|
||||
|
||||
return null
|
||||
@@ -89,7 +89,7 @@
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
|
||||
@@ -60,10 +60,9 @@
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
|
||||
if(node) return
|
||||
var/node_connect = dir
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
for(var/cdir in cardinal)
|
||||
node = findConnecting(cdir)
|
||||
if(node)
|
||||
break
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/Destroy()
|
||||
|
||||
@@ -334,22 +334,25 @@ mob/living
|
||||
src << "You must be conscious to do this!"
|
||||
return
|
||||
|
||||
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/unary/starting_machine)
|
||||
for(var/datum/pipeline/pipeline in starting_machine.network.line_members)
|
||||
for(var/atom/A in (pipeline.members || pipeline.edges))
|
||||
var/image/new_image = image(A, A.loc, dir = A.dir)
|
||||
pipes_shown += new_image
|
||||
client.images += new_image
|
||||
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine)
|
||||
var/datum/pipe_network/network = starting_machine.return_network(starting_machine)
|
||||
if(!network)
|
||||
return
|
||||
for(var/datum/pipeline/pipeline in network.line_members)
|
||||
for(var/obj/machinery/atmospherics/A in (pipeline.members || pipeline.edges))
|
||||
if(!A.pipe_image)
|
||||
A.pipe_image = image(A, A.loc, layer = 20, dir = A.dir) //the 20 puts it above Byond's darkness (not its opacity view)
|
||||
pipes_shown += A.pipe_image
|
||||
client.images += A.pipe_image
|
||||
|
||||
/mob/living/proc/remove_ventcrawl()
|
||||
for(var/image/current_image in pipes_shown)
|
||||
client.images -= current_image
|
||||
if(client)
|
||||
for(var/image/current_image in pipes_shown)
|
||||
client.images -= current_image
|
||||
client.eye = src
|
||||
|
||||
pipes_shown.len = 0
|
||||
|
||||
if(client)
|
||||
client.eye = src
|
||||
|
||||
/mob/living/carbon/clean_blood()
|
||||
. = ..()
|
||||
if(ishuman(src))
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
//If they're SSD, remove it so they can wake back up.
|
||||
player_logged = 0
|
||||
|
||||
//login during ventcrawl
|
||||
if(istype(loc, /obj/machinery/atmospherics)) //attach us back into the pipes
|
||||
remove_ventcrawl()
|
||||
add_ventcrawl(loc)
|
||||
|
||||
//Round specific stuff like hud updates
|
||||
if(ticker && ticker.mode)
|
||||
var/ref = "\ref[mind]"
|
||||
|
||||
Reference in New Issue
Block a user