From 72fbf9a1811d07fff9f3f7e2cd93e4a4a8207dbd Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Tue, 9 Feb 2016 23:06:43 -0600 Subject: [PATCH] Fix click catcher runtime Check that a turf exists when attempting to click it This can happen if someone manages to click off the edge of the Z-level The following runtime has occured 48 time(s). runtime error: Cannot execute null.Click(). proc name: Click (/obj/screen/click_catcher/Click) source file: click.dm,345 usr: Drone (758) (/mob/living/simple_animal/drone) src: (/obj/screen/click_catcher) --- code/_onclick/click.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index e8297662c85..ce33b9097f4 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -342,5 +342,6 @@ C.swap_hand() else var/turf/T = screen_loc2turf(modifiers["screen-loc"], get_turf(usr)) - T.Click(location, control, params) + if(T) + T.Click(location, control, params) return 1