Skip to content

Commit

Permalink
Merge pull request NebulaSS13#4551 from NebulaSS13/stable
Browse files Browse the repository at this point in the history
Updating staging from stable
  • Loading branch information
MistakeNot4892 authored Nov 9, 2024
2 parents cca47ba + 31a8027 commit 9411d74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions code/modules/atmospherics/datum_pipeline.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@

if(air?.volume || liquid?.total_volume)
temporarily_store_fluids()
QDEL_NULL(air)
QDEL_NULL(liquid)

QDEL_NULL(air)
QDEL_NULL(liquid)

for(var/obj/machinery/atmospherics/pipe/P in members)
P.parent = null
Expand All @@ -51,25 +52,28 @@
for(var/obj/machinery/atmospherics/pipe/member in members)
if(!member.check_pressure(pressure))
members.Remove(member)

// Safety check.
if(member.parent == src)
member.parent = null
break //Only delete 1 pipe per process

/datum/pipeline/proc/temporarily_store_fluids()
//Update individual gas_mixtures by volume ratio

var/liquid_transfer_per_pipe = min(REAGENT_UNITS_PER_PIPE, (liquid && length(members)) ? (liquid.total_volume / length(members)) : 0)
if(!liquid_transfer_per_pipe && !liquid_transfer_per_pipe)
if(!air?.volume && !liquid_transfer_per_pipe)
return

for(var/obj/machinery/atmospherics/pipe/member in members)

if(air?.volume)
member.air_temporary = new
member.air_temporary.copy_from(air)
member.air_temporary.volume = member.volume
member.air_temporary.multiply(member.volume / air.volume)

if(liquid_transfer_per_pipe)
member.liquid_temporary = new(REAGENT_UNITS_PER_PIPE, src)
member.liquid_temporary = new(REAGENT_UNITS_PER_PIPE, member)
liquid.trans_to_holder(member.liquid_temporary, liquid_transfer_per_pipe)

/datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/pipe/base)
Expand Down
1 change: 1 addition & 0 deletions code/modules/atmospherics/pipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
//TODO: leak to turf, doing pfshhhhh
if(prob(5))
burst()
else return 1

else return 1

Expand Down

0 comments on commit 9411d74

Please sign in to comment.