mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Ensures update_pipe_vision is called only when you switch pipenets. Fixes lag caused by ventcrawlers (#19620)
* Ensures update_pipe_vision is called only when you switch pipenets * Comments baby
This commit is contained in:
@@ -157,6 +157,13 @@ Pipelines + Other Objects -> Pipe network
|
||||
/obj/machinery/atmospherics/proc/returnPipenet()
|
||||
return
|
||||
|
||||
/**
|
||||
* Whether or not this atmos machine has multiple pipenets attached to it
|
||||
* Used to determine if a ventcrawler should update their vision or not
|
||||
*/
|
||||
/obj/machinery/atmospherics/proc/is_pipenet_split()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/returnPipenetAir()
|
||||
return
|
||||
|
||||
@@ -317,7 +324,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
user.forceMove(target_move.loc) //handles entering and so on
|
||||
user.visible_message("You hear something squeezing through the ducts.", "You climb out of the ventilation system.")
|
||||
else if(target_move.can_crawl_through())
|
||||
if(returnPipenet(target_move) != target_move.returnPipenet())
|
||||
if(is_pipenet_split()) // Going away from a split means we want to update the view of the pipenet
|
||||
user.update_pipe_vision(target_move)
|
||||
user.forceMove(target_move)
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
|
||||
@@ -128,6 +128,9 @@
|
||||
else if(A == node2)
|
||||
return parent2
|
||||
|
||||
/obj/machinery/atmospherics/binary/is_pipenet_split()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/binary/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
if(Old == parent1)
|
||||
parent1 = New
|
||||
|
||||
@@ -181,6 +181,9 @@
|
||||
else if(A == node3)
|
||||
return parent3
|
||||
|
||||
/obj/machinery/atmospherics/trinary/is_pipenet_split()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/trinary/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
if(Old == parent1)
|
||||
parent1 = New
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
parent = null
|
||||
|
||||
/obj/machinery/atmospherics/pipe/returnPipenet(obj/machinery/atmospherics/A)
|
||||
if(A)
|
||||
return // It's called by a moving mob that's already in the pipenet
|
||||
return parent
|
||||
|
||||
/obj/machinery/atmospherics/pipe/detailed_examine()
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
|
||||
|
||||
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
|
||||
update_pipe_vision()
|
||||
update_pipe_vision(loc)
|
||||
|
||||
return .
|
||||
|
||||
Reference in New Issue
Block a user