Files
Bubberstation/code/controllers/subsystem/mobs.dm
vuonojenmustaturska 39375d5cc2 Replaces a bunch of mob loops with hopefully better ones (#32786)
* Free codebase churn

* fixes dviewmob

* a commit

* Partial revert "Free codebase churn"

This reverts commit 9dd41b3860c331637bbc85e694dd32dc59768ad5.

* better fix to dviewmob

* renames living_mob_list to alive_mob_list, adds mob_living_list and carbon_list

* make some use out of the shiny carbon list

* make some use out of the shiny new living list

* more things, also make the mobs subsystem (Life) use living list

* bonus

* domo arigato mr. roboto

* compile fixes, also made the drone code less dumb

* better?

* make admin message prettier

* honk

* fixes blobs

* rev fixes

* one small thing
2017-11-16 23:08:40 +01:00

32 lines
806 B
Plaintext

SUBSYSTEM_DEF(mobs)
name = "Mobs"
priority = 100
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_living_list.len]")
/datum/controller/subsystem/mobs/fire(resumed = 0)
var/seconds = wait * 0.1
if (!resumed)
src.currentrun = GLOB.mob_living_list.Copy()
if (GLOB.overminds.len) // blob cameras need to Life()
src.currentrun += GLOB.overminds
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
var/times_fired = src.times_fired
while(currentrun.len)
var/mob/M = currentrun[currentrun.len]
currentrun.len--
if(M)
M.Life(seconds, times_fired)
else
GLOB.mob_living_list.Remove(M)
if (MC_TICK_CHECK)
return