Life refactor (#13471)

* Life Refactor WIP

* part 2

* part 3

* runtime fix

* newlines

* tweaks

* perspective checks

* fixes

* remote view tweaks

* more fixes

* robot fixes

* better updating

* cleaned up icon procs

* less proc call overhead

* performance gains

* more optimization

* shorter lists, removal of unecesary code

* gene OOP and dna styling cleanup

* oops

* axe disabilities

* typeless loop

* various tweaks and fixes

* brain checks

* runtime fixes

* cryo vision fixes
This commit is contained in:
Fox McCloud
2020-06-03 19:43:30 -06:00
committed by GitHub
parent 5d824a9c62
commit 70b46d8aea
183 changed files with 1943 additions and 2286 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ SUBSYSTEM_DEF(afk)
/datum/controller/subsystem/afk/fire()
var/list/toRemove = list()
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(!H.ckey) // Useless non ckey creatures
continue
+3 -2
View File
@@ -497,13 +497,14 @@ SUBSYSTEM_DEF(jobs)
job.after_spawn(H)
//Gives glasses to the vision impaired
if(H.disabilities & DISABILITY_FLAG_NEARSIGHTED)
if(NEARSIGHTED in H.mutations)
var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses)
if(equipped != 1)
var/obj/item/clothing/glasses/G = H.glasses
if(istype(G) && !G.prescription)
G.prescription = 1
G.prescription = TRUE
G.name = "prescription [G.name]"
H.update_nearsighted_effects()
return H
+6 -6
View File
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(mobs)
var/static/list/cubemonkeys = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_list.len]")
..("P:[GLOB.mob_living_list.len]")
/datum/controller/subsystem/mobs/Initialize(start_timeofday)
clients_by_zlevel = new /list(world.maxz,0)
@@ -21,17 +21,17 @@ SUBSYSTEM_DEF(mobs)
/datum/controller/subsystem/mobs/fire(resumed = 0)
var/seconds = wait * 0.1
if(!resumed)
src.currentrun = GLOB.mob_list.Copy()
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
while(currentrun.len)
var/mob/M = currentrun[currentrun.len]
var/mob/living/L = currentrun[currentrun.len]
currentrun.len--
if(M)
M.Life(seconds, times_fired)
if(L)
L.Life(seconds, times_fired)
else
GLOB.mob_list.Remove(M)
GLOB.mob_living_list.Remove(L)
if(MC_TICK_CHECK)
return
+1 -1
View File
@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(weather)
var/datum/weather/W = V
if(W.aesthetic || W.stage != MAIN_STAGE)
continue
for(var/i in GLOB.living_mob_list)
for(var/i in GLOB.mob_living_list)
var/mob/living/L = i
if(W.can_weather_act(L))
W.weather_act(L)