From 0349f8c90803b5d5a4a06ddf24baa715da7030af Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 29 May 2017 11:03:03 -0500 Subject: [PATCH 1/3] Holocall cleanup --- code/datums/holocall.dm | 23 +++++++++++------------ code/game/machinery/hologram.dm | 7 +++++++ code/game/machinery/hologram.dm.rej | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 code/game/machinery/hologram.dm.rej diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index a3157e6514..a2a26652cd 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -43,18 +43,18 @@ //cleans up ALL references :) /datum/holocall/Destroy() - user.reset_perspective() - if(user.client) - for(var/datum/camerachunk/chunk in eye.visibleCameraChunks) - chunk.remove(eye) - user.remote_control = 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) - user = null 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 @@ -62,6 +62,7 @@ dialed_holopads.Cut() if(calling_holopad) + calling_holopad.outgoing_call = null calling_holopad.SetLightsAndPower() calling_holopad = null if(connected_holopad) @@ -86,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 @@ -152,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.") diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 7cf0b69d7d..7a8adfa0c8 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -75,6 +75,13 @@ Possible to do for anyone motivated enough: stat &= ~NOPOWER else stat |= ~NOPOWER + if(outgoing_call) + outgoing_call.ConnectionFailure(src) + +/obj/machinery/holopad/obj_break() + . = ..() + if(outgoing_call) + outgoing_call.ConnectionFailure(src) /obj/machinery/holopad/RefreshParts() var/holograph_range = 4 diff --git a/code/game/machinery/hologram.dm.rej b/code/game/machinery/hologram.dm.rej new file mode 100644 index 0000000000..b2237e799d --- /dev/null +++ b/code/game/machinery/hologram.dm.rej @@ -0,0 +1,16 @@ +diff a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm (rejected hunks) +@@ -58,13 +58,11 @@ Possible to do for anyone motivated enough: + + /obj/machinery/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) From c483767431569cf66ececee4e885c731b1edfc38 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Fri, 2 Jun 2017 21:50:11 -0700 Subject: [PATCH 2/3] Update hologram.dm --- code/game/machinery/hologram.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 7a8adfa0c8..47f02acdc2 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -58,12 +58,11 @@ Possible to do for anyone motivated enough: /obj/machinery/holopad/Destroy() if(outgoing_call) - LAZYADD(holo_calls, outgoing_call) + 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) @@ -399,4 +398,4 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ req_components = list(/obj/item/weapon/stock_parts/capacitor = 1) #undef HOLOPAD_PASSIVE_POWER_USAGE -#undef HOLOGRAM_POWER_USAGE \ No newline at end of file +#undef HOLOGRAM_POWER_USAGE From 224f1d8bd18d6955b26593a34d09d7037ac406e0 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Fri, 2 Jun 2017 21:50:17 -0700 Subject: [PATCH 3/3] Delete hologram.dm.rej --- code/game/machinery/hologram.dm.rej | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 code/game/machinery/hologram.dm.rej diff --git a/code/game/machinery/hologram.dm.rej b/code/game/machinery/hologram.dm.rej deleted file mode 100644 index b2237e799d..0000000000 --- a/code/game/machinery/hologram.dm.rej +++ /dev/null @@ -1,16 +0,0 @@ -diff a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm (rejected hunks) -@@ -58,13 +58,11 @@ Possible to do for anyone motivated enough: - - /obj/machinery/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)