mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-20 11:32:51 +01:00
Scheduler now uses btime, and other improvements
This commit is contained in:
@@ -4,20 +4,26 @@
|
||||
/datum/controller/process/mob/setup()
|
||||
name = "mob"
|
||||
schedule_interval = 20 // every 2 seconds
|
||||
updateQueueInstance = new
|
||||
start_delay = 16
|
||||
|
||||
/datum/controller/process/mob/started()
|
||||
..()
|
||||
if(!updateQueueInstance)
|
||||
if(!mob_list)
|
||||
mob_list = list()
|
||||
else if(mob_list.len)
|
||||
updateQueueInstance = new
|
||||
if(!mob_list)
|
||||
mob_list = list()
|
||||
|
||||
/datum/controller/process/mob/doWork()
|
||||
if(updateQueueInstance)
|
||||
updateQueueInstance.init(mob_list, "Life")
|
||||
updateQueueInstance.Run()
|
||||
for(last_object in mob_list)
|
||||
var/mob/M = last_object
|
||||
if(isnull(M.gcDestroyed))
|
||||
try
|
||||
M.Life()
|
||||
catch(var/exception/e)
|
||||
catchException(e, M)
|
||||
SCHECK
|
||||
else
|
||||
catchBadType(M)
|
||||
mob_list -= M
|
||||
|
||||
/datum/controller/process/mob/getStatName()
|
||||
return ..()+"([mob_list.len])"
|
||||
/datum/controller/process/mob/statProcess()
|
||||
..()
|
||||
stat(null, "[mob_list.len] mobs")
|
||||
Reference in New Issue
Block a user