Corrects supermatter fluctuations v2

- Better implementation of #10714
- This fix corrects the issue by merging pipenet process to machinery process to ensure order of execution doesn't change randomly. This shouldn't have any performance effect as pipenet process doesn't have much work anyway (not to be confused with air process that runs ZAS, this one only called process() on each pipenet). Screenshot of profiler (pipenet process highlighted, idle server with one player, engine set up) http://i.imgur.com/ecCg6rS.png
- Unlike previous fix, this does not come with various game-affecting side effects, players shouldn't see a change (except for the fact that odd fluctuations introduced by devmerge disappear). Previous fix buffed engine output as side effect, and caused one TEG to generate considerably more than second TEG, which caused TEGs to begin sparking despite overall output being below 1MW.
This commit is contained in:
Atlantis
2015-08-20 22:23:45 +02:00
parent 968a9d0f59
commit e30e461843
3 changed files with 9 additions and 16 deletions

View File

@@ -6,6 +6,7 @@
/datum/controller/process/machinery/doWork()
internal_sort()
internal_process_pipenets()
internal_process_machinery()
internal_process_power()
internal_process_power_drain()
@@ -57,6 +58,14 @@
processing_power_items.Remove(I)
scheck()
/datum/controller/process/machinery/proc/internal_process_pipenets()
for(var/datum/pipe_network/pipeNetwork in pipe_networks)
if(istype(pipeNetwork) && !pipeNetwork.disposed)
pipeNetwork.process()
scheck()
continue
pipe_networks.Remove(pipeNetwork)
/datum/controller/process/machinery/getStatName()
return ..()+"([machines.len])"

View File

@@ -1,15 +0,0 @@
/datum/controller/process/pipenet/setup()
name = "pipenet"
schedule_interval = 20 // every 2 seconds
/datum/controller/process/pipenet/doWork()
for(var/datum/pipe_network/pipeNetwork in pipe_networks)
if(istype(pipeNetwork) && !pipeNetwork.disposed)
pipeNetwork.process()
scheck()
continue
pipe_networks.Remove(pipeNetwork)
/datum/controller/process/pipenet/getStatName()
return ..()+"([pipe_networks.len])"