Merge pull request #9049 from MistakeNot4892/mobsleep

Adding some debug logic to SSmobs to try and chase down the sleeping issue.
This commit is contained in:
Sypsoti
2023-03-11 08:35:03 -06:00
committed by GitHub

View File

@@ -13,16 +13,17 @@ SUBSYSTEM_DEF(mobs)
var/log_extensively = FALSE
var/list/timelog = list()
var/list/busy_z_levels = list()
var/slept_mobs = 0
var/list/slept = list()
var/skipped_mobs = 0
/datum/controller/subsystem/mobs/stat_entry()
..("P: [global.mob_list.len] | S: [slept_mobs]")
..("P: [global.mob_list.len] | S: [skipped_mobs]")
/datum/controller/subsystem/mobs/fire(resumed, no_mc_tick)
var/list/busy_z_levels = src.busy_z_levels
if (!resumed)
slept_mobs = 0
skipped_mobs = 0
src.currentrun = mob_list.Copy()
busy_z_levels.Cut()
for(var/played_mob in player_list)
@@ -45,9 +46,17 @@ SUBSYSTEM_DEF(mobs)
// Obviously we should try and get rid of this for performance reasons when we can.
try
if(M.low_priority && !(M.z in busy_z_levels))
slept_mobs++
skipped_mobs++
if (MC_TICK_CHECK)
return
continue
var/time = world.time
M.Life(times_fired)
if(time != world.time && !slept[M.type])
slept[M.type] = TRUE
log_debug("SSmobs: Type '[M.type]' slept for [world.time - time]ds in Life(). Suppressing further warnings.")
catch(var/exception/e)
log_runtime(e, M, "Caught by [name] subsystem")