From b6a5ffd8ff56320355dbecfb930a716ec9e9662e Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 4 Jul 2017 23:04:20 -0400 Subject: [PATCH] Makes ListTargets Much Faster --- code/modules/mob/living/simple_animal/hostile/hostile.dm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 911f66a5527..50fab332201 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -98,10 +98,8 @@ /mob/living/simple_animal/hostile/proc/ListTargets()//Step 1, find out what we can see - . = list() if(!search_objects) - var/list/Mobs = hearers(vision_range, targets_from) - src //Remove self, so we don't suicide - . += Mobs + . = hearers(vision_range, targets_from) - src //Remove self, so we don't suicide var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/mecha, /obj/spacepod)) @@ -109,8 +107,7 @@ if(can_see(targets_from, HM, vision_range)) . += HM else - var/list/Objects = oview(vision_range, targets_from) - . += Objects + . = oview(vision_range, targets_from) /mob/living/simple_animal/hostile/proc/FindTarget(var/list/possible_targets, var/HasTargetsList = 0)//Step 2, filter down possible targets to things we actually care about . = list()