Makes for loops use GLOB.human_list. Should improve performance a bit. Fixes blood contract affecting dead crew (#13691)

* Replaces all human in X to GLOB.human_list

* crew monitor

* no playerlist converts

* forgot to stage there...
This commit is contained in:
farie82
2020-07-21 22:43:24 +02:00
committed by GitHub
parent cb48f4fe8c
commit cdc762975c
16 changed files with 60 additions and 32 deletions
+9 -5
View File
@@ -460,8 +460,9 @@ Gunshots/explosions/opening doors/less rare audio (done)
target = T
var/image/A = null
var/kind = force_kind ? force_kind : pick("clown", "corgi", "carp", "skeleton", "demon","zombie")
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
if(H == target)
for(var/thing in GLOB.human_list)
var/mob/living/carbon/human/H = thing
if(H.stat == DEAD || H == target)
continue
if(skip_nearby && (H in view(target)))
continue
@@ -539,7 +540,8 @@ Gunshots/explosions/opening doors/less rare audio (done)
var/mob/living/carbon/human/clone = null
var/clone_weapon = null
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
for(var/thing in GLOB.human_list)
var/mob/living/carbon/human/H = thing
if(H.stat || H.lying)
continue
clone = H
@@ -751,8 +753,10 @@ GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/gun/projectile, /obj/ite
target.client.images.Remove(speech_overlay)
else // Radio talk
var/list/humans = list()
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
humans += H
for(var/thing in GLOB.human_list)
var/mob/living/carbon/human/H = thing
if(H.stat != DEAD)
humans += H
person = pick(humans)
target.hear_radio(message_to_multilingual(pick(radio_messages), pick(person.languages)), speaker = person, part_a = "<span class='[SSradio.frequency_span_class(PUB_FREQ)]'><b>\[[get_frequency_name(PUB_FREQ)]\]</b> <span class='name'>", part_b = "</span> <span class='message'>")
qdel(src)