diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 930e8244eb6..6b546345398 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -297,6 +297,18 @@ Turf and target are seperate in case you want to teleport some distance from a t . += A return . +/proc/active_ais_samezlevel(/mob/M) + . = list() + for(var/mob/living/silicon/ai/A in living_mob_list) + if(A.stat == DEAD) + continue + if(A.control_disabled == 1) + continue + if(A.z != M.z) + continue + . += A + return . + //Find an active ai with the least borgs. VERBOSE PROCNAME HUH! /proc/select_active_ai_with_fewest_borgs() var/mob/living/silicon/ai/selected @@ -308,7 +320,7 @@ Turf and target are seperate in case you want to teleport some distance from a t return selected /proc/select_active_ai(var/mob/user) - var/list/ais = active_ais() + var/list/ais = active_ais_samezlevel(user) if(ais.len) if(user) . = input(usr,"AI signals detected:", "AI selection") in ais else . = pick(ais) @@ -550,17 +562,17 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl var/turf/current = get_turf(source) var/turf/target_turf = get_turf(target) var/steps = 1 - + if(current != target_turf) - current = get_step_towards(current, target_turf) + current = get_step_towards(current, target_turf) while(current != target_turf) - if(steps > length) + if(steps > length) return 0 - if(current.opacity) + if(current.opacity) return 0 for(var/thing in current) var/atom/A = thing - if(A.opacity) + if(A.opacity) return 0 current = get_step_towards(current, target_turf) steps++ @@ -1863,7 +1875,7 @@ var/global/list/g_fancy_list_of_types = null pois[name] = A return pois - + /proc/flash_color(mob_or_client, flash_color="#960000", flash_time=20) var/client/C if(istype(mob_or_client, /mob)) @@ -1881,7 +1893,7 @@ var/global/list/g_fancy_list_of_types = null C.color = flash_color spawn(0) animate(C, color = initial(C.color), time = flash_time) - + #define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255))) /proc/make_bit_triplet() @@ -1891,4 +1903,4 @@ var/global/list/g_fancy_list_of_types = null var/num = pick(num_sample) num_sample -= num result += (1 << num) - return result + return result diff --git a/code/modules/computer3/computers/law.dm b/code/modules/computer3/computers/law.dm index dd88322a8ab..534efe3a9eb 100644 --- a/code/modules/computer3/computers/law.dm +++ b/code/modules/computer3/computers/law.dm @@ -24,7 +24,7 @@ attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params) - if(!is_station_level(user.z)) + if(is_away_level(user.z)) to_chat(user, "Unable to establish a connection: You're too far away from the station!") return if(istype(module, /obj/item/weapon/aiModule)) @@ -60,7 +60,7 @@ attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params) if(istype(module, /obj/item/weapon/aiModule)) - if(!is_station_level(user.z)) + if(is_away_level(user.z)) to_chat(user, "Unable to establish a connection: You're too far away from the station!") return module.install(src)