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
|
||||
|
||||
Reference in New Issue
Block a user