mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Unregulated passive regulators don't limit flow (#6657)
This commit is contained in:
@@ -67,6 +67,8 @@
|
|||||||
pressure_delta = input_starting_pressure - target_pressure
|
pressure_delta = input_starting_pressure - target_pressure
|
||||||
if (REGULATE_OUTPUT)
|
if (REGULATE_OUTPUT)
|
||||||
pressure_delta = target_pressure - output_starting_pressure
|
pressure_delta = target_pressure - output_starting_pressure
|
||||||
|
if (REGULATE_NONE)
|
||||||
|
pressure_delta = input_starting_pressure - output_starting_pressure
|
||||||
|
|
||||||
//-1 if pump_gas() did not move any gas, >= 0 otherwise
|
//-1 if pump_gas() did not move any gas, >= 0 otherwise
|
||||||
var/returnval = -1
|
var/returnval = -1
|
||||||
@@ -82,9 +84,46 @@
|
|||||||
transfer_moles = min(transfer_moles, calculate_transfer_moles(air2, air1, pressure_delta, (network1)? network1.volume : 0))
|
transfer_moles = min(transfer_moles, calculate_transfer_moles(air2, air1, pressure_delta, (network1)? network1.volume : 0))
|
||||||
if (REGULATE_OUTPUT)
|
if (REGULATE_OUTPUT)
|
||||||
transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, (network2)? network2.volume : 0))
|
transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, (network2)? network2.volume : 0))
|
||||||
|
if (REGULATE_NONE)
|
||||||
|
var/source = air1
|
||||||
|
var/sink = air2
|
||||||
|
// If node1 is a network of more than 1 pipe, we want to transfer from that whole network, otw use just node1, as current
|
||||||
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||||
|
var/obj/machinery/atmospherics/pipe/p = node1
|
||||||
|
if(istype(p.parent, /datum/pipeline)) // Nested if-blocks to avoid the mystical :
|
||||||
|
var/datum/pipeline/l = p.parent
|
||||||
|
if(istype(l.air, /datum/gas_mixture))
|
||||||
|
source = l.air
|
||||||
|
// If node2 is a network of more than 1 pipe, we want to transfer to that whole network, otw use just node2, as current
|
||||||
|
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||||
|
var/obj/machinery/atmospherics/pipe/p = node2
|
||||||
|
if(istype(p.parent, /datum/pipeline))
|
||||||
|
var/datum/pipeline/l = p.parent
|
||||||
|
if(istype(l.air, /datum/gas_mixture))
|
||||||
|
sink = l.air
|
||||||
|
transfer_moles = max(0, calculate_equalize_moles(source, sink)) // Not regulated, don't care about flow rate
|
||||||
|
|
||||||
//pump_gas() will return a negative number if no flow occurred
|
//pump_gas() will return a negative number if no flow occurred
|
||||||
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
|
if(regulate_mode == REGULATE_NONE) // ACTUALLY move gases from the whole network, not just the immediate pipes
|
||||||
|
var/source = air1
|
||||||
|
var/sink = air2
|
||||||
|
// If node1 is a network of more than 1 pipe, we want to transfer from that whole network, otw use just node1, as current
|
||||||
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||||
|
var/obj/machinery/atmospherics/pipe/p = node1
|
||||||
|
if(istype(p.parent, /datum/pipeline)) // Nested if-blocks to avoid the mystical :
|
||||||
|
var/datum/pipeline/l = p.parent
|
||||||
|
if(istype(l.air, /datum/gas_mixture))
|
||||||
|
source = l.air
|
||||||
|
// If node2 is a network of more than 1 pipe, we want to transfer to that whole network, otw use just node2, as current
|
||||||
|
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||||
|
var/obj/machinery/atmospherics/pipe/p = node2
|
||||||
|
if(istype(p.parent, /datum/pipeline))
|
||||||
|
var/datum/pipeline/l = p.parent
|
||||||
|
if(istype(l.air, /datum/gas_mixture))
|
||||||
|
sink = l.air
|
||||||
|
returnval = pump_gas_passive(src, source, sink, transfer_moles)
|
||||||
|
else
|
||||||
|
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
|
||||||
|
|
||||||
if (returnval >= 0)
|
if (returnval >= 0)
|
||||||
if(network1)
|
if(network1)
|
||||||
|
|||||||
36
html/changelogs/atermonera - unregulatorinator.yml
Normal file
36
html/changelogs/atermonera - unregulatorinator.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: Atermonera
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||||
|
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||||
|
changes:
|
||||||
|
- tweak: "Unregulated pressure regulators (Regulation set to OFF) no longer limit flow rate, and instead act as one-way opened valves. For best results, place away from other pumps."
|
||||||
Reference in New Issue
Block a user