Scheduler, observation, and New() tweaks.

Corrects a number of places where New() did not call ..(), and implements similar changes to attempt to ensure New()/initialize() complete running before qdel() runs.
Cuts down on the number of created items during server start.
This commit is contained in:
PsiOmegaDelta
2015-12-27 17:44:53 +01:00
parent 1a8fc50f1e
commit a4545f8ded
28 changed files with 107 additions and 88 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
/var/global/datum/controller/process/scheduler/scheduler
/var/datum/controller/process/scheduler/scheduler
/************
* Scheduler *
@@ -39,9 +39,12 @@
/**********
* Helpers *
**********/
/proc/schedule_task_in(var/in_time, var/procedure, var/list/arguments)
/proc/schedule_task_in(var/in_time, var/procedure, var/list/arguments = list())
schedule_task(world.time + in_time, procedure, arguments)
/proc/schedule_task_with_source_in(var/in_time, var/source, var/procedure, var/list/arguments = list())
schedule_task_with_source(world.time + in_time, source, procedure, arguments)
/proc/schedule_task(var/trigger_time, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task(trigger_time, procedure, arguments, /proc/destroy_scheduled_task, list())
scheduler.schedule(st)
@@ -69,6 +72,7 @@
var/list/task_after_process_args
/datum/scheduled_task/New(var/trigger_time, var/procedure, var/list/arguments, var/proc/task_after_process, var/list/task_after_process_args)
..()
src.trigger_time = trigger_time
src.procedure = procedure
src.arguments = arguments ? arguments : list()
+2 -1
View File
@@ -47,7 +47,8 @@ datum/controller/game_controller/proc/setup_objects()
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
sleep(-1)
for(var/atom/movable/object in world)
object.initialize()
if(isnull(object.gcDestroyed))
object.initialize()
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
sleep(-1)