From 9db4138a4f5eab31fbca09d32ab9d54a9871da56 Mon Sep 17 00:00:00 2001 From: rockdtben Date: Sat, 1 Oct 2011 20:24:34 +0000 Subject: [PATCH] -Fixed a runtime error. The shock code for grilles assumed that all grilles have cables connected to them. Fixed that. runtime error: list index out of bounds proc name: electrocute mob (/proc/electrocute_mob) source file: power.dm,453 usr: Brett Prescott (/mob/living/carbon/human) src: null call stack: electrocute mob(Brett Prescott (/mob/living/carbon/human), the power cable (/obj/cable), the grille (/obj/grille), 1) the grille (/obj/grille): shock(Brett Prescott (/mob/living/carbon/human), 70) the grille (/obj/grille): attack hand(Brett Prescott (/mob/living/carbon/human), 1) the grille (/obj/grille): DblClick() the grille (/obj/grille): Click(the floor (97,118,1) (/turf/simulated/floor), "mapwindow.map", "icon-x=16;icon-y=12;left=1;scr...") Brokenriddle (/client): Click(the grille (/obj/grille), the floor (97,118,1) (/turf/simulated/floor), "mapwindow.map", "icon-x=16;icon-y=12;left=1;scr...") git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2306 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/grille.dm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/code/game/objects/grille.dm b/code/game/objects/grille.dm index ac4f3dd8ffb..5ea24163a47 100644 --- a/code/game/objects/grille.dm +++ b/code/game/objects/grille.dm @@ -147,13 +147,16 @@ if(!prob(prb)) return 0 var/turf/T = get_turf(src) - if (electrocute_mob(user, T.get_cable_node(), src)) - var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread - s.set_up(5, 1, src) - s.start() - return 1 - else - return 0 + var/obj/cable/C = T.get_cable_node() + if(C) + if (electrocute_mob(user, C, src)) + var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread + s.set_up(5, 1, src) + s.start() + return 1 + else + return 0 + return 0