Mob AI SS & Misc. Mob Cleanup (#3990)

This commit is contained in:
Lohikar
2017-12-24 14:24:55 -06:00
committed by GitHub
parent 071045b28e
commit 6feaf1a218
39 changed files with 589 additions and 547 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/var/datum/controller/subsystem/mobs/SSmob
/datum/controller/subsystem/mobs
name = "Mobs"
name = "Mobs - Life"
flags = SS_NO_INIT
priority = SS_PRIORITY_MOB
+66
View File
@@ -0,0 +1,66 @@
/var/datum/controller/subsystem/mob_ai/SSmob_ai
/datum/controller/subsystem/mob_ai
name = "Mobs - AI"
flags = SS_NO_INIT
priority = SS_PRIORITY_MOB
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()
..("P:[processing.len]")
/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
+10 -3
View File
@@ -25,13 +25,12 @@
var/list/datum/feedback_variable/feedback = list()
var/status_needs_update = FALSE
/datum/controller/subsystem/statistics/New()
NEW_SS_GLOBAL(SSfeedback)
/datum/controller/subsystem/statistics/Initialize(timeofday)
if (!config.kick_inactive && !(config.sql_enabled && config.sql_stats))
can_fire = FALSE
for (var/type in subtypesof(/datum/statistic) - list(/datum/statistic/numeric, /datum/statistic/grouped))
var/datum/statistic/S = new type
if (!S.name)
@@ -70,6 +69,14 @@
var/err = query.ErrorMsg()
log_game("SQL ERROR during population polling. Error : \[[err]\]\n")
if (status_needs_update)
// Update world status.
world.update_status()
status_needs_update = FALSE
/datum/controller/subsystem/statistics/proc/update_status()
status_needs_update = TRUE
/datum/controller/subsystem/statistics/Recover()
src.messages = SSfeedback.messages
src.messages_admin = SSfeedback.messages_admin