diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index dd97f4f8050..38b87eae38c 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -86,6 +86,16 @@ if(!beehome) . += "This bee is homeless!" +/mob/living/simple_animal/hostile/poison/bees/ListTargets() // Bee processing is expessive, so we override them finding targets here. + if(!search_objects) //In case we want to have purely hostile bees + return ..() + else + . = list() // The following code is only very slightly slower than just returning oview(vision_range, targets_from), but it saves us much more work down the line + var/list/searched_for = oview(vision_range, targets_from) + for(var/obj/A in searched_for) + . += A + for(var/mob/A in searched_for) + . += A /mob/living/simple_animal/hostile/poison/bees/proc/generate_bee_visuals() cut_overlays() diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ca0a96a8dee..2f1a51cd09d 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -127,7 +127,7 @@ //////////////HOSTILE MOB TARGETTING AND AGGRESSION//////////// -/mob/living/simple_animal/hostile/proc/ListTargets()//Step 1, find out what we can see +/mob/living/simple_animal/hostile/proc/ListTargets() //Step 1, find out what we can see if(!search_objects) . = hearers(vision_range, targets_from) - src //Remove self, so we don't suicide @@ -137,11 +137,7 @@ if(can_see(targets_from, HM, vision_range)) . += HM else - . = list() // The following code is only very slightly slower than just returning oview(vision_range, targets_from), but it saves us much more work down the line, particularly when bees are involved - for (var/obj/A in oview(vision_range, targets_from)) - . += A - for (var/mob/A in oview(vision_range, targets_from)) - . += A + . = oview(vision_range, targets_from) /mob/living/simple_animal/hostile/proc/FindTarget(list/possible_targets, HasTargetsList = 0)//Step 2, filter down possible targets to things we actually care about . = list()