From 88d97c87d8fbbd756c1fba802faaeba7b746dec1 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Mon, 29 May 2017 00:31:15 -0400 Subject: [PATCH] beepbeep --- code/datums/holocall.dm | 24 ++++++++++++++---------- code/game/machinery/hologram.dm | 14 ++++++++++---- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 0bb793b0944..9eb4bc1a3e7 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -39,14 +39,18 @@ //cleans up ALL references :) /datum/holocall/Destroy() + if(!qdeleted(user)) + user.reset_perspective() + if(user.client) + for(var/datum/camerachunk/chunk in eye.visibleCameraChunks) + chunk.remove(eye) + user.remote_control = null + user = null QDEL_NULL(eye) - user.reset_perspective() - - user = null - hologram.HC = null - hologram = null - calling_holopad.outgoing_call = null + if(hologram) + hologram.HC = null + hologram = null for(var/I in dialed_holopads) var/obj/machinery/hologram/holopad/H = I @@ -54,12 +58,14 @@ dialed_holopads.Cut() if(calling_holopad) + calling_holopad.outgoing_call = null calling_holopad.SetLightsAndPower() calling_holopad = null if(connected_holopad) connected_holopad.SetLightsAndPower() connected_holopad = null + return ..() //Gracefully disconnects a holopad `H` from a call. Pads not in the call are ignored. Notifies participants of the disconnection @@ -76,7 +82,7 @@ //Forcefully disconnects a holopad `H` from a call. Pads not in the call are ignored. /datum/holocall/proc/ConnectionFailure(obj/machinery/hologram/holopad/H, graceful = FALSE) if(H == connected_holopad || H == calling_holopad) - if(!graceful) + if(!graceful && H != calling_holopad) calling_holopad.atom_say("Connection failure.") qdel(src) return @@ -142,9 +148,7 @@ . = !qdeleted(user) && !user.incapacitated() && !qdeleted(calling_holopad) && !(calling_holopad.stat & NOPOWER) && user.loc == calling_holopad.loc if(.) - if(connected_holopad) - . = !qdeleted(connected_holopad) && !(connected_holopad.stat & NOPOWER) - else + if(!connected_holopad) . = world.time < (call_start_time + HOLOPAD_MAX_DIAL_TIME) if(!.) calling_holopad.atom_say("No answer recieved.") diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index d22d499e7f8..3a84d4abdc6 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -65,19 +65,25 @@ var/list/holopads = list() /obj/machinery/hologram/holopad/Destroy() if(outgoing_call) - LAZYADD(holo_calls, outgoing_call) - outgoing_call = null + outgoing_call.ConnectionFailure(src) for(var/I in holo_calls) var/datum/holocall/HC = I HC.ConnectionFailure(src) - LAZYCLEARLIST(holo_calls) for (var/I in masters) clear_holo(I) holopads -= src return ..() +/obj/machinery/hologram/holopad/power_change() + if (powered()) + stat &= ~NOPOWER + else + stat |= ~NOPOWER + if(outgoing_call) + outgoing_call.ConnectionFailure(src) + /obj/machinery/hologram/holopad/RefreshParts() var/holograph_range = 4 for(var/obj/item/weapon/stock_parts/capacitor/B in component_parts) @@ -116,7 +122,7 @@ var/list/holopads = list() user.set_machine(src) interact(user) -/obj/machinery/hologram/holopad/attack_hand(mob/living/carbon/human/user) +/obj/machinery/hologram/holopad/AltClick(mob/living/carbon/human/user) if(..()) return