-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
This commit is contained in:
rockdtben
2011-10-01 20:24:34 +00:00
parent a71691759c
commit 9db4138a4f

View File

@@ -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