mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Code Efficiency update by Ccomp, fuck recursive checking
This commit is contained in:
@@ -193,7 +193,20 @@
|
||||
|
||||
var/list/objects = list()
|
||||
|
||||
var/list/obj_to_check = list() //IF SOMEONE DOESN'T HEAR SOMETHING AND ARE IN INSIDE A CONTAINER ADD IT TO THIS LIST.
|
||||
obj_to_check += typesof(/obj/item/device/paicard)
|
||||
obj_to_check += typesof(/obj/item/device/aicard)
|
||||
obj_to_check += typesof(/obj/machinery/computer/aifixer)
|
||||
|
||||
for(var/obj/O in range) //Get a list of objects in hearing range. We'll check to see if any clients have their "eye" set to the object
|
||||
if(istype(O, /obj/item/device/radio)) //This avoids all that bullshit with recursion. FUCK RECURSION ~Ccomp
|
||||
hear += O
|
||||
if(O.type in obj_to_check)
|
||||
for(var/mob/living/M in O.contents)
|
||||
if(!(M in hear))
|
||||
hear += M
|
||||
|
||||
|
||||
objects += O
|
||||
|
||||
for(var/client/C in clients)
|
||||
@@ -207,11 +220,9 @@
|
||||
hear += C.mob
|
||||
|
||||
else if(!(C.mob in hear))
|
||||
if(C.mob.loc && C.mob.loc in (hear|objects))
|
||||
if(C.mob.loc in (hear|objects))
|
||||
hear += C.mob
|
||||
else if(C.mob.loc.loc && C.mob.loc.loc in (hear|objects))
|
||||
hear += C.mob
|
||||
else if(C.mob.loc.loc.loc && C.mob.loc.loc.loc in (hear|objects)) //Going a little deeper
|
||||
else if(C.mob.loc.loc in (hear|objects))
|
||||
hear += C.mob
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user