From c1cc1691badd7cb6fef461c3f3d9695aa4ce0aff Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sun, 12 Mar 2023 00:41:38 +1100 Subject: [PATCH] Adding some debug logic to SSmobs to try and chase down the sleeping issue. --- code/controllers/subsystems/mobs.dm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/code/controllers/subsystems/mobs.dm b/code/controllers/subsystems/mobs.dm index fdb6173d8f..8cc461e81a 100644 --- a/code/controllers/subsystems/mobs.dm +++ b/code/controllers/subsystems/mobs.dm @@ -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")