From 87aef935869e4a3eaf5192c69ac3a8e0068afc5d Mon Sep 17 00:00:00 2001 From: asciodev <81930475+asciodev@users.noreply.github.com> Date: Wed, 1 May 2024 20:36:02 -0400 Subject: [PATCH] Allow borgs to use holopads (#25094) * Allow borgs to use holopads * Revert kludge cyborg icon fix in favor of sane fix * Further remove cyborg hologram kludge For cyborgs, a false value was previously set for the safety argument when calling `/proc/getHologramIcon` (from commit 17c96bc24d). This was because the `icon/A` parameter was mistakenly set to `robot.icon`, which caused a runtime error to occur when `Height()` is called on it in line 1008, preventing cyborg holograms from appearing. Setting a false safety value made use of the so-conditional `new(A)` call on line 1003, which created a new icon from the `robot.icon` string. This kludge prevented a runtime and made cyborg holograms appear. The kludge was removed in commit dbb8851ae3, but the false safety value remained. This commit fixes that. * Update code/game/machinery/hologram.dm Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/game/machinery/hologram.dm | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index ef3c41ec96c..e5d1d70d4a4 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -156,7 +156,7 @@ GLOBAL_LIST_EMPTY(holopads) var/datum/holocall/HC = I HC.Disconnect(src) -/obj/machinery/hologram/holopad/interact(mob/living/carbon/human/user) //Carn: hologram requests. +/obj/machinery/hologram/holopad/interact(mob/living/user) if(!istype(user)) return if(!anchored) @@ -262,20 +262,24 @@ GLOBAL_LIST_EMPTY(holopads) updateDialog() //do not allow AIs to answer calls or people will use it to meta the AI satellite -/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) - if(!istype(user)) +/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai_or_robot) + var/mob/living/silicon/ai/ai = ai_or_robot + var/mob/living/silicon/robot/robot = ai_or_robot + if(!istype(ai) && !istype(robot)) return if(outgoing_call) return + if(istype(robot)) + interact(robot) /*There are pretty much only three ways to interact here. I don't need to check for client since they're clicking on an object. This may change in the future but for now will suffice.*/ - if(user.eyeobj.loc != loc)//Set client eye on the object if it's not already. - user.eyeobj.setLoc(get_turf(src)) - else if(!LAZYLEN(masters) || !masters[user])//If there is no hologram, possibly make one. - activate_holo(user, 1) + else if(ai.eyeobj.loc != loc)//Set client eye on the object if it's not already. + ai.eyeobj.setLoc(get_turf(src)) + else if(!LAZYLEN(masters) || !masters[ai])//If there is no hologram, possibly make one. + activate_holo(ai, 1) else//If there is a hologram, remove it. - clear_holo(user) + clear_holo(ai) /obj/machinery/hologram/holopad/process() for(var/I in masters) @@ -373,8 +377,13 @@ GLOBAL_LIST_EMPTY(holopads) if(isAI(user)) hologram.icon = AI.holo_icon else //make it like real life - hologram.icon = getHologramIcon(get_id_photo(user)) - hologram.icon_state = user.icon_state + if(isrobot(user)) + var/mob/living/silicon/robot/robot = user + hologram.icon = getHologramIcon(icon(robot.icon)) + hologram.icon_state = robot.icon_state + else + hologram.icon = getHologramIcon(get_id_photo(user)) + hologram.icon_state = user.icon_state hologram.alpha = 100 hologram.Impersonation = user