diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 22d6bfcf6aa..ae72f8b012f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1742,7 +1742,7 @@ var/mob/dview/dview_mob = new if(!istype(A, type)) continue var/distance = get_dist(source, A) - if(!closest_atom) + if(!closest_distance) closest_distance = distance closest_atom = A else diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 90c504d634b..afbb17e9ac2 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -116,7 +116,7 @@ hologram.HC = src //eyeobj code is horrid, this is the best copypasta I could make - eye = new + eye = new() eye.origin = H eye.eye_initialized = TRUE eye.eye_user = user @@ -124,7 +124,7 @@ user.remote_control = eye user.remote_view = 1 user.reset_perspective(eye) - eye.setLoc(H.loc) + eye.setLoc(eye.loc) //Checks the validity of a holocall and qdels itself if it's not. Returns TRUE if valid, FALSE otherwise /datum/holocall/proc/Check() diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index d7e6ba10079..884c19185b1 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -29,9 +29,8 @@ Possible to do for anyone motivated enough: // 1 = AREA BASED #define HOLOPAD_PASSIVE_POWER_USAGE 1 #define HOLOGRAM_POWER_USAGE 2 -#define RANGE_BASED 4 -var/const/HOLOPAD_MODE = RANGE_BASED +var/const/HOLOPAD_MODE = 0 var/list/holopads = list() @@ -240,14 +239,21 @@ var/list/holopads = list() if(!qdeleted(master) && !master.incapacitated() && master.client && (!AI || AI.eyeobj))//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector. if(!(stat & NOPOWER))//If the machine has power. if(AI) //ais are range based - if(get_dist(AI.eyeobj, src) <= holo_range) - continue + if(HOLOPAD_MODE == 0) + if(get_dist(AI.eyeobj, src) <= holo_range) + return 1 else - var/obj/machinery/hologram/holopad/pad_close = get_closest_atom(/obj/machinery/hologram/holopad, holopads, AI.eyeobj) - if(get_dist(pad_close, AI.eyeobj) <= holo_range) - unset_holo(master) - activate_holo(master, 1) - continue + var/area/holo_area = get_area(src) + var/area/eye_area = get_area(AI.eyeobj) + + if(eye_area != holo_area) + clear_holo(master) + return 1 + + var/obj/machinery/hologram/holopad/pad_close = get_closest_atom(/obj/machinery/hologram/holopad, holopads, AI.eyeobj) + if(get_dist(pad_close, AI.eyeobj) <= holo_range) + unset_holo(AI) + pad_close.activate_holo(AI, 1) else continue clear_holo(master)//If not, we want to get rid of the hologram. @@ -270,12 +276,7 @@ var/list/holopads = list() if(masters[user]) var/obj/effect/overlay/holo_pad_hologram/H = masters[user] step_to(H, new_turf) - H.loc = new_turf - var/area/holo_area = get_area(src) - var/area/eye_area = new_turf.loc - - if(eye_area != holo_area) - clear_holo(user) + H.forceMove(new_turf) return 1 /obj/machinery/hologram/holopad/proc/activate_holo(mob/living/user, var/force = 0) @@ -315,6 +316,7 @@ var/list/holopads = list() else to_chat(user, "ERROR: \black Unable to project hologram.") + return /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/