Files
Aurora.3/code/controllers/subsystems/mob_ai.dm
Fluffy b183188689 Better logging (#16164)
* Initial

* Cleared duplicates

* More work, get rid of log_error

* more

* log_debug() to macro LOG_DEBUG

* More work

* More

* Guh

* Maybe better?

* More work

* gah

* Dear lord

* *inserts swears here*

* gdi

* More work

* More

* dear lord

* fsdfsdafs

* rsdaf

* sadfasf

* sdafsad

* fgsd

* small fuckup fix

* jfsd

* sdafasf

* gdi

* sdfa

* sfdafgds

* sdafasdvf

* sdfasdfg

* sdfsga

* asdf

* dsfasfsagf

* ihibhbjh

* fsadf

* adfas

* sdafsad

* sdfasd

* fsda

* vhb

* asf

* for arrow

* removed source file-line logging, added header for tgui
2023-08-05 21:53:11 +00:00

75 lines
1.5 KiB
Plaintext

/var/datum/controller/subsystem/mob_ai/SSmob_ai
/datum/controller/subsystem/mob_ai
name = "Mobs - AI"
flags = SS_NO_INIT
priority = SS_PRIORITY_MOB
runlevels = RUNLEVELS_PLAYING
var/list/processing = list()
var/list/currentrun = list()
var/list/slept = list()
/datum/controller/subsystem/mob_ai/New()
NEW_SS_GLOBAL(SSmob_ai)
/datum/controller/subsystem/mob_ai/stat_entry(msg)
msg = "P:[processing.len]"
return ..()
/datum/controller/subsystem/mob_ai/fire(resumed = FALSE)
if (!resumed)
src.currentrun = processing.Copy()
var/list/currentrun = src.currentrun
while (currentrun.len)
var/mob/M = currentrun[currentrun.len]
currentrun.len--
if (QDELETED(M))
processing -= M
if (MC_TICK_CHECK)
return
continue
if (M.ckey)
// cliented mobs are not allowed to think
LOG_DEBUG("SSmob_ai: Type '[M.type]' was still thinking despite having a client!")
MOB_STOP_THINKING(M)
if (MC_TICK_CHECK)
return
continue
var/time = world.time
if (!M.frozen && !M.stat)
M.think()
if (time != world.time && !slept[M.type])
slept[M.type] = TRUE
var/diff = world.time - time
LOG_DEBUG("SSmob_ai: Type '[M.type]' slept for [diff] ds in think()! Suppressing further warnings.")
if (MC_TICK_CHECK)
return
/mob
var/tmp/thinking_enabled = FALSE
/mob/proc/think()
return
/mob/proc/on_think_disabled()
walk_to(src, 0)
/mob/proc/on_think_enabled()
return
/datum/controller/subsystem/mob_ai/ExplosionStart()
suspend()
/datum/controller/subsystem/mob_ai/ExplosionEnd()
wake()