Merge pull request #1287 from Citadel-Station-13/upstream-merge-27801

[MIRROR] Holocall cleanup
This commit is contained in:
LetterJay
2017-06-05 23:19:23 -05:00
committed by GitHub
2 changed files with 21 additions and 17 deletions
+13 -15
View File
@@ -43,19 +43,18 @@
//cleans up ALL references :)
/datum/holocall/Destroy()
user.reset_perspective()
if(!QDELETED(eye) && user.client)
for(var/datum/camerachunk/chunk in eye.visibleCameraChunks)
chunk.remove(eye)
qdel(eye)
eye = null
user.remote_control = null
user = null
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)
if(hologram)
hologram.HC = null
hologram = null
calling_holopad.outgoing_call = null
hologram = null
for(var/I in dialed_holopads)
var/obj/machinery/holopad/H = I
@@ -63,6 +62,7 @@
dialed_holopads.Cut()
if(calling_holopad)
calling_holopad.outgoing_call = null
calling_holopad.SetLightsAndPower()
calling_holopad = null
if(connected_holopad)
@@ -87,7 +87,7 @@
/datum/holocall/proc/ConnectionFailure(obj/machinery/holopad/H, graceful = FALSE)
testing("Holocall connection failure: graceful [graceful]")
if(H == connected_holopad || H == calling_holopad)
if(!graceful)
if(!graceful && H != calling_holopad)
calling_holopad.say("Connection failure.")
qdel(src)
return
@@ -153,9 +153,7 @@
. = !QDELETED(user) && !user.incapacitated() && !QDELETED(calling_holopad) && calling_holopad.is_operational() && user.loc == calling_holopad.loc
if(.)
if(connected_holopad)
. = !QDELETED(connected_holopad) && connected_holopad.is_operational()
else
if(!connected_holopad)
. = world.time < (call_start_time + HOLOPAD_MAX_DIAL_TIME)
if(!.)
calling_holopad.say("No answer recieved.")