Files
drsingh 6c5b1596a5 more changes to the process scheduling and LAGCHECK to spread things out properly under severe load
sped up the delete loop because it shouldn't lock up the server anymore
fixed that door flicker because it was seriously annoying me
2016-03-12 23:53:34 -08:00

65 lines
1.4 KiB
Plaintext

// handles mobs
datum/controller/process/mobs
var/tmp/list/detailed_count
var/tmp/tick_counter
var/list/mobs
var/list/living = list()
var/list/wraiths = list()
var/list/adminghosts = list()
setup()
name = "Mob"
schedule_interval = 20
detailed_count = new
src.mobs = global.mobs
copyStateFrom(var/datum/controller/process/mobs/other)
detailed_count = other.detailed_count
doWork()
src.mobs = global.mobs
var/c
for(var/mob/living/M in src.mobs)
M.Life(src)
if (!(c++ % 5))
scheck()
for(var/mob/wraith/W in src.mobs)
W.Life(src)
scheck()
// For periodic antag overlay updates (Convair880).
for (var/mob/dead/G in src.mobs)
if (isadminghost(G))
G:Life(src)
scheck()
/*
for(var/mob/living/M in src.mobs)
tick_counter = world.timeofday
M.Life(src)
tick_counter = world.timeofday - tick_counter
if (M && tick_counter > 0)
detailed_count["[M.type]-[M.name]"] += tick_counter
scheck(currentTick)
// a r g h
for (var/mob/wraith/W in src.mobs)
W.Life(src)
scheck(currentTick)
*/
tickDetail()
if (detailed_count && detailed_count.len)
var/stats = "<b>[name] ticks:</b><br>"
var/count
for (var/thing in detailed_count)
count = detailed_count[thing]
if (count > 4)
stats += "[thing] used [count] ticks.<br>"
boutput(usr, "<br>[stats]")