Optimize memory usage by eliminating/changing some lists

Ported from TG: Object armors are no longer defined in (unique) lists but rather datums that can be cached depending on their armor values.
Add LAZYSET define to lazily initialize a list then assigning a key to a value
Add alldirs2 global which is the same as alldirs except diagonals go first
Optimize mob memory by making alerts list lazy
Optimize obj/machinery memory by making use_log and settagwhitelist lists lazy
Optimize atom memory by not creating hud_list list for all atoms
Optimize turf memory by not creating footstep_sounds list for all turfs
Clean up code where possible
This commit is contained in:
mochi
2020-06-22 00:46:14 +02:00
parent ebeee921ca
commit 65d0ecaed3
11 changed files with 285 additions and 218 deletions
@@ -226,7 +226,7 @@ Des: Removes all infected images from the alien.
/mob/living/carbon/alien/handle_footstep(turf/T)
if(..())
if(T.footstep_sounds["xeno"])
if(T.footstep_sounds && T.footstep_sounds["xeno"])
var/S = pick(T.footstep_sounds["xeno"])
if(S)
if(m_intent == MOVE_INTENT_RUN)
@@ -81,7 +81,7 @@
/mob/living/carbon/human/handle_footstep(turf/T)
if(..())
if(T.footstep_sounds["human"])
if(T.footstep_sounds && T.footstep_sounds["human"])
var/S = pick(T.footstep_sounds["human"])
if(S)
if(m_intent == MOVE_INTENT_RUN)