mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-21 06:42:54 +00:00
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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user