From b2ec8f89e0619641e9a0b49e216e972b8c9654b3 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Thu, 5 Jul 2018 01:27:07 -0400 Subject: [PATCH] missed files --- code/controllers/subsystem/throwing.dm | 21 ++++++++++++++----- code/game/atoms.dm | 5 +++++ code/game/machinery/computer/apc_control.dm | 2 +- .../machinery/computer/launchpad_control.dm | 2 +- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/code/controllers/subsystem/throwing.dm b/code/controllers/subsystem/throwing.dm index bfb7099ed2..2b9c0f3653 100644 --- a/code/controllers/subsystem/throwing.dm +++ b/code/controllers/subsystem/throwing.dm @@ -26,7 +26,7 @@ SUBSYSTEM_DEF(throwing) var/atom/movable/AM = currentrun[currentrun.len] var/datum/thrownthing/TT = currentrun[AM] currentrun.len-- - if (!AM || !TT) + if (QDELETED(AM) || QDELETED(TT)) processing -= AM if (MC_TICK_CHECK) return @@ -61,6 +61,15 @@ SUBSYSTEM_DEF(throwing) var/delayed_time = 0 var/last_move = 0 +/datum/thrownthing/Destroy() + SSthrowing.processing -= thrownthing + thrownthing.throwing = null + thrownthing = null + target = null + thrower = null + callback = null + return ..() + /datum/thrownthing/proc/tick() var/atom/movable/AM = thrownthing if (!isturf(AM.loc) || !AM.throwing) @@ -113,15 +122,15 @@ SUBSYSTEM_DEF(throwing) return /datum/thrownthing/proc/finalize(hit = FALSE, target=null) - set waitfor = 0 - SSthrowing.processing -= thrownthing + set waitfor = FALSE //done throwing, either because it hit something or it finished moving - thrownthing.throwing = null + if(!thrownthing) + return if (!hit) for (var/thing in get_turf(thrownthing)) //looking for our target on the turf we land on. var/atom/A = thing if (A == target) - hit = 1 + hit = TRUE thrownthing.throw_impact(A, src) break if (!hit) @@ -136,6 +145,8 @@ SUBSYSTEM_DEF(throwing) if (callback) callback.Invoke() + qdel(src) + /datum/thrownthing/proc/hit_atom(atom/A) finalize(hit=TRUE, target=A) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 980ba7e7bc..32e982e8e6 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -532,6 +532,11 @@ /atom/Entered(atom/movable/AM, atom/oldLoc) SEND_SIGNAL(src, COMSIG_ATOM_ENTERED, AM, oldLoc) +/atom/Exit(atom/movable/AM, atom/newLoc) + . = ..() + if(SEND_SIGNAL(src, COMSIG_ATOM_EXIT, AM, newLoc) & COMPONENT_ATOM_BLOCK_EXIT) + return FALSE + /atom/Exited(atom/movable/AM, atom/newLoc) SEND_SIGNAL(src, COMSIG_ATOM_EXITED, AM, newLoc) diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 6ade93b520..30574fdae4 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -137,7 +137,7 @@ active_apc = APC if(href_list["name_filter"]) playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) - var/new_filter = stripped_input(usr, "What name are you looking for?", name) as null|text + var/new_filter = stripped_input(usr, "What name are you looking for?", name) if(!src || !usr || !usr.canUseTopic(src) || stat || QDELETED(src)) return log_activity("changed name filter to \"[new_filter]\"") diff --git a/code/game/machinery/computer/launchpad_control.dm b/code/game/machinery/computer/launchpad_control.dm index fd785e5bc6..d1f450013b 100644 --- a/code/game/machinery/computer/launchpad_control.dm +++ b/code/game/machinery/computer/launchpad_control.dm @@ -128,7 +128,7 @@ pad.x_offset = 0 if(href_list["change_name"]) - var/new_name = stripped_input(usr, "What do you wish to name the launchpad?", "Launchpad", pad.display_name, 15) as text|null + var/new_name = stripped_input(usr, "What do you wish to name the launchpad?", "Launchpad", pad.display_name, 15) if(!new_name) return pad.display_name = new_name