Files
Bubberstation/code/controllers/subsystem/mobs.dm
SkyratBot 20fa5e6e2c [MIRROR] Removes some done todos (and ones that I think are dumb) [MDB IGNORE] (#25362)
* Removes some done todos (and ones that I think are dumb) (#80017)

## About The Pull Request

Most of these are mine that I just forgot about, only one I think anyone
cares about is the one in mobs.dm about making delta time match
subsystem yielding, but I think it's a bad idea so it's gone

Oh also, replaces an old comment of mine with an actual explanation
(it's about the icon cache and shit)

* Removes some done todos (and ones that I think are dumb)

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-11-30 20:10:54 -06:00

46 lines
1.5 KiB
Plaintext

SUBSYSTEM_DEF(mobs)
name = "Mobs"
priority = FIRE_PRIORITY_MOBS
flags = SS_KEEP_TIMING | SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
wait = 2 SECONDS
var/list/currentrun = list()
///only contains living players for some reason
var/static/list/clients_by_zlevel[][]
var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that.
var/static/list/cubemonkeys = list()
var/static/list/cheeserats = list()
/datum/controller/subsystem/mobs/stat_entry(msg)
msg = "P:[length(GLOB.mob_living_list)]"
return ..()
/datum/controller/subsystem/mobs/proc/MaxZChanged()
if (!islist(clients_by_zlevel))
clients_by_zlevel = new /list(world.maxz,0)
dead_players_by_zlevel = new /list(world.maxz,0)
while (clients_by_zlevel.len < world.maxz)
clients_by_zlevel.len++
clients_by_zlevel[clients_by_zlevel.len] = list()
dead_players_by_zlevel.len++
dead_players_by_zlevel[dead_players_by_zlevel.len] = list()
/datum/controller/subsystem/mobs/fire(resumed = FALSE)
if (!resumed)
src.currentrun = GLOB.mob_living_list.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
var/times_fired = src.times_fired
var/seconds_per_tick = wait / (1 SECONDS)
while(currentrun.len)
var/mob/living/L = currentrun[currentrun.len]
currentrun.len--
if(L)
L.Life(seconds_per_tick, times_fired)
else
GLOB.mob_living_list.Remove(L)
if (MC_TICK_CHECK)
return