From 717e635d28a1913cefc468285c0fbecfe4e056ab Mon Sep 17 00:00:00 2001 From: AnturK Date: Wed, 6 Jun 2018 21:24:17 +0200 Subject: [PATCH] Fixes some holocall stuff (#38209) * Fixes some holocall stuff * Yep --- code/datums/holocall.dm | 19 +++++++++++++------ code/game/machinery/hologram.dm | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 12070f6fe2..ef4edbb6cf 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -60,14 +60,19 @@ user.remote_control = null if(!QDELETED(eye)) - qdel(eye) - eye = null + eye.RemoveImages() + QDEL_NULL(eye) + + if(connected_holopad && !QDELETED(hologram)) + hologram = null + connected_holopad.clear_holo(user) user = null - if(hologram) + //Hologram survived holopad destro + if(!QDELETED(hologram)) hologram.HC = null - hologram = null + QDEL_NULL(hologram) for(var/I in dialed_holopads) var/obj/machinery/holopad/H = I @@ -90,9 +95,10 @@ /datum/holocall/proc/Disconnect(obj/machinery/holopad/H) testing("Holocall disconnect") if(H == connected_holopad) - calling_holopad.say("[usr] disconnected.") + var/area/A = get_area(connected_holopad) + calling_holopad.say("[A] holopad disconnected.") else if(H == calling_holopad && connected_holopad) - connected_holopad.say("[usr] disconnected.") + connected_holopad.say("[user] disconnected.") ConnectionFailure(H, TRUE) @@ -154,6 +160,7 @@ eye.setLoc(H.loc) hangup = new(eye, src) + hangup.Grant(user) //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 887335f16a..e5aef868fc 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -666,7 +666,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/effect/overlay/holo_pad_hologram/Destroy() Impersonation = null - if(HC) + if(!QDELETED(HC)) HC.Disconnect(HC.calling_holopad) return ..()