mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Initial GC fixes/tweaks/cleanup/documenting
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
//#endif
|
||||
|
||||
for(var/obj/machinery/M in machines)
|
||||
if(M && !M.gcDestroyed)
|
||||
if(M && isnull(M.gcDestroyed))
|
||||
#ifdef PROFILE_MACHINES
|
||||
var/time_start = world.timeofday
|
||||
#endif
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
machine_profiling[M.type] += (time_end - time_start)
|
||||
#endif
|
||||
else
|
||||
machines -= M
|
||||
|
||||
scheck()
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
/datum/controller/process/pipenet/doWork()
|
||||
for(var/datum/pipe_network/pipeNetwork in pipe_networks)
|
||||
if(istype(pipeNetwork) && !pipeNetwork.disposed)
|
||||
if(istype(pipeNetwork) && isnull(pipeNetwork.gcDestroyed))
|
||||
pipeNetwork.process()
|
||||
scheck()
|
||||
continue
|
||||
|
||||
pipe_networks.Remove(pipeNetwork)
|
||||
else
|
||||
pipe_networks -= pipeNetwork
|
||||
|
||||
@@ -8,18 +8,15 @@ var/global/list/power_machinery_profiling = list()
|
||||
schedule_interval = 20 // every 2 seconds
|
||||
|
||||
/datum/controller/process/power_machinery/doWork()
|
||||
for(var/i = 1 to power_machines.len)
|
||||
if(i > power_machines.len)
|
||||
break
|
||||
var/obj/machinery/M = power_machines[i]
|
||||
if(istype(M) && !M.gcDestroyed)
|
||||
for(var/obj/machinery/M in power_machines)
|
||||
if(istype(M) && isnull(M.gcDestroyed))
|
||||
#ifdef PROFILE_MACHINES
|
||||
var/time_start = world.timeofday
|
||||
#endif
|
||||
|
||||
if(M.process() == PROCESS_KILL)
|
||||
M.inMachineList = 0
|
||||
power_machines.Remove(M)
|
||||
power_machines -= M
|
||||
continue
|
||||
|
||||
if(M && M.use_power)
|
||||
@@ -34,12 +31,10 @@ var/global/list/power_machinery_profiling = list()
|
||||
power_machinery_profiling[M.type] += (time_end - time_start)
|
||||
#endif
|
||||
else
|
||||
if(!power_machines.Remove(M))
|
||||
power_machines.Cut(i,i+1)
|
||||
power_machines -= M
|
||||
else
|
||||
if(M)
|
||||
if(istype(M))
|
||||
M.inMachineList = 0
|
||||
if(!power_machines.Remove(M))
|
||||
power_machines.Cut(i,i+1)
|
||||
power_machines -= M
|
||||
|
||||
scheck()
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
/datum/controller/process/powernet/doWork()
|
||||
for(var/datum/powernet/powerNetwork in powernets)
|
||||
if(istype(powerNetwork) && !powerNetwork.disposed)
|
||||
if(istype(powerNetwork) && isnull(powerNetwork.gcDestroyed))
|
||||
powerNetwork.reset()
|
||||
scheck()
|
||||
continue
|
||||
|
||||
powernets.Remove(powerNetwork)
|
||||
else
|
||||
powernets -= powerNetwork
|
||||
|
||||
Reference in New Issue
Block a user