mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Optimization to the radiation of thermal plates. Instead of each thermal plate calling radiate() every single tick, thermal plates in the same network (which equalizes every tick) will simply copy over the gases once the first radiate() is called. Then the networks radiate() value will be reset.
This commit is contained in:
@@ -69,6 +69,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/thermal_plate/proc/radiate()
|
||||
if(network && network.radiate) //Since each member of a network has the same gases each tick
|
||||
air_contents.copy_from(network.radiate) //We can cut down on processing time by only calculating radiate() once and then applying the result
|
||||
return 1
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
@@ -86,5 +89,6 @@
|
||||
|
||||
if (network)
|
||||
network.update = 1
|
||||
network.radiate = air_contents
|
||||
|
||||
return 1
|
||||
|
||||
@@ -9,6 +9,7 @@ var/global/list/datum/pipe_network/pipe_networks = list()
|
||||
|
||||
var/update = 1
|
||||
var/datum/gas_mixture/air_transient = null
|
||||
var/datum/gas_mixture/radiate = null
|
||||
|
||||
/datum/pipe_network/New()
|
||||
air_transient = new()
|
||||
@@ -37,6 +38,7 @@ var/global/list/datum/pipe_network/pipe_networks = list()
|
||||
if(update)
|
||||
update = 0
|
||||
reconcile_air() //equalize_gases(gases)
|
||||
radiate = null //Reset our last ticks calculation for the post-radiate() gases inside a thermal plate
|
||||
|
||||
#ifdef ATMOS_PIPELINE_PROCESSING
|
||||
//Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport
|
||||
|
||||
Reference in New Issue
Block a user