mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-03-15
# Conflicts: # README.md # code/__defines/mobs.dm # code/__defines/subsystems.dm # code/_helpers/global_lists.dm # code/controllers/subsystems/garbage.dm # code/controllers/subsystems/overlays.dm # code/datums/datacore.dm # code/datums/supplypacks/munitions.dm # code/game/machinery/suit_storage_unit.dm # code/game/objects/items/devices/communicator/UI.dm # code/game/objects/items/weapons/id cards/station_ids.dm # code/game/objects/random/random.dm # code/game/turfs/simulated/floor.dm # code/game/turfs/simulated/floor_icon.dm # code/modules/awaymissions/gateway.dm # code/modules/client/preferences.dm # code/modules/ext_scripts/python.dm # code/modules/mob/living/carbon/human/human.dm # code/modules/mob/living/carbon/human/life.dm # code/modules/mob/living/carbon/human/species/station/station.dm # code/modules/mob/living/carbon/human/species/virtual_reality/avatar.dm # code/modules/mob/living/carbon/human/update_icons.dm # code/modules/mob/living/living.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/living/simple_animal/animals/bear.dm # code/modules/mob/mob_helpers.dm # code/modules/mob/new_player/new_player.dm # code/modules/mob/new_player/preferences_setup.dm # code/modules/mob/new_player/sprite_accessories.dm # code/modules/organs/organ_external.dm # code/modules/organs/organ_icon.dm # code/modules/organs/robolimbs.dm # code/modules/reagents/reagent_containers/glass.dm # code/modules/reagents/reagent_containers/syringes.dm # html/changelogs/.all_changelog.yml # maps/southern_cross/southern_cross-1.dmm # maps/southern_cross/southern_cross-3.dmm # maps/southern_cross/southern_cross-4.dmm # maps/southern_cross/southern_cross-6.dmm # vorestation.dme
This commit is contained in:
@@ -8,19 +8,21 @@
|
||||
|
||||
/datum/controller/process/scheduler/setup()
|
||||
name = "scheduler"
|
||||
schedule_interval = 3 SECONDS
|
||||
schedule_interval = 1 SECOND
|
||||
scheduled_tasks = list()
|
||||
scheduler = src
|
||||
|
||||
/datum/controller/process/scheduler/doWork()
|
||||
var/world_time = world.time
|
||||
for(last_object in scheduled_tasks)
|
||||
var/datum/scheduled_task/scheduled_task = last_object
|
||||
if(world_time < scheduled_task.trigger_time)
|
||||
break // Too early for this one, and therefore too early for all remaining.
|
||||
try
|
||||
if(world.time > scheduled_task.trigger_time)
|
||||
unschedule(scheduled_task)
|
||||
scheduled_task.pre_process()
|
||||
scheduled_task.process()
|
||||
scheduled_task.post_process()
|
||||
unschedule(scheduled_task)
|
||||
scheduled_task.pre_process()
|
||||
scheduled_task.process()
|
||||
scheduled_task.post_process()
|
||||
catch(var/exception/e)
|
||||
catchException(e, last_object)
|
||||
SCHECK
|
||||
@@ -45,7 +47,7 @@
|
||||
stat(null, "[scheduled_tasks.len] task\s")
|
||||
|
||||
/datum/controller/process/scheduler/proc/schedule(var/datum/scheduled_task/st)
|
||||
scheduled_tasks += st
|
||||
dd_insertObjectList(scheduled_tasks, st)
|
||||
|
||||
/datum/controller/process/scheduler/proc/unschedule(var/datum/scheduled_task/st)
|
||||
scheduled_tasks -= st
|
||||
@@ -106,6 +108,9 @@
|
||||
task_after_process_args.Cut()
|
||||
return ..()
|
||||
|
||||
/datum/scheduled_task/dd_SortValue()
|
||||
return trigger_time
|
||||
|
||||
/datum/scheduled_task/proc/pre_process()
|
||||
task_triggered_event.raise_event(list(src))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user