Removes delta_time from the atmos system. (#57478)

Why?

delta_time is about maintaining behavior when changing the wait of subsystems
SSair's wait is dynamic by design, we hardly ever hit below it. What is important then, is maintaining behavior
across each process.

The key point here is making sure excited groups and turfs share the same amoumt of gas each process, no matter
how high or low wait is. This is why subprocesses are a thing in the first place, to maintain this consistency.
delta_time fucks with this, and will end up changing behavior if wait is ever changed.
This commit is contained in:
LemonInTheDark
2021-03-07 22:11:02 -08:00
committed by GitHub
parent 6320fc87bc
commit 0001ae31cd
12 changed files with 50 additions and 52 deletions

View File

@@ -82,7 +82,6 @@ SUBSYSTEM_DEF(air)
/datum/controller/subsystem/air/fire(resumed = FALSE)
var/timer = TICK_USAGE_REAL
var/delta_time = wait * 0.1
// Every time we fire, we want to make sure pipenets are rebuilt. The game state could have changed between each fire() proc call
// and anything missing a pipenet can lead to unintended behaviour at worse and various runtimes at best.
@@ -103,7 +102,7 @@ SUBSYSTEM_DEF(air)
timer = TICK_USAGE_REAL
if(!resumed)
cached_cost = 0
process_pipenets(delta_time, resumed)
process_pipenets(resumed)
cached_cost += TICK_USAGE_REAL - timer
if(state != SS_RUNNING)
return
@@ -115,7 +114,7 @@ SUBSYSTEM_DEF(air)
timer = TICK_USAGE_REAL
if(!resumed)
cached_cost = 0
process_atmos_machinery(delta_time, resumed)
process_atmos_machinery(resumed)
cached_cost += TICK_USAGE_REAL - timer
if(state != SS_RUNNING)
return
@@ -139,7 +138,7 @@ SUBSYSTEM_DEF(air)
timer = TICK_USAGE_REAL
if(!resumed)
cached_cost = 0
process_hotspots(delta_time, resumed)
process_hotspots(resumed)
cached_cost += TICK_USAGE_REAL - timer
if(state != SS_RUNNING)
return
@@ -198,7 +197,7 @@ SUBSYSTEM_DEF(air)
SStgui.update_uis(SSair) //Lightning fast debugging motherfucker
/datum/controller/subsystem/air/proc/process_pipenets(delta_time, resumed = FALSE)
/datum/controller/subsystem/air/proc/process_pipenets(resumed = FALSE)
if (!resumed)
src.currentrun = networks.Copy()
//cache for sanic speed (lists are references anyways)
@@ -207,7 +206,7 @@ SUBSYSTEM_DEF(air)
var/datum/thing = currentrun[currentrun.len]
currentrun.len--
if(thing)
thing.process(delta_time)
thing.process()
else
networks.Remove(thing)
if(MC_TICK_CHECK)
@@ -231,7 +230,7 @@ SUBSYSTEM_DEF(air)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_atmos_machinery(delta_time, resumed = FALSE)
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = FALSE)
if (!resumed)
src.currentrun = atmos_machinery.Copy()
//cache for sanic speed (lists are references anyways)
@@ -239,7 +238,7 @@ SUBSYSTEM_DEF(air)
while(currentrun.len)
var/obj/machinery/M = currentrun[currentrun.len]
currentrun.len--
if(!M || (M.process_atmos(delta_time) == PROCESS_KILL))
if(!M || (M.process_atmos() == PROCESS_KILL))
atmos_machinery.Remove(M)
if(MC_TICK_CHECK)
return
@@ -257,7 +256,7 @@ SUBSYSTEM_DEF(air)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_hotspots(delta_time, resumed = FALSE)
/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
if (!resumed)
src.currentrun = hotspots.Copy()
//cache for sanic speed (lists are references anyways)
@@ -266,7 +265,7 @@ SUBSYSTEM_DEF(air)
var/obj/effect/hotspot/H = currentrun[currentrun.len]
currentrun.len--
if (H)
H.process(delta_time)
H.process()
else
hotspots -= H
if(MC_TICK_CHECK)