From ed4150312723a162c331ebfd5129fe55a6ae7f6d Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sun, 6 May 2018 15:03:43 +0300 Subject: [PATCH] Merge pull request #37676 from AverageJoe82/electric-grill-engine Prevents electric grills from mass producing lightning through exploits --- code/game/objects/structures/grille.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index f1fbd1febd..5aa88cb0d9 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -263,12 +263,14 @@ /obj/structure/grille/hitby(AM as mob|obj) if(isobj(AM)) if(prob(50) && anchored && !broken) - var/turf/T = get_turf(src) - var/obj/structure/cable/C = T.get_cable_node() - if(C) - playsound(src, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5) - tesla_zap(src, 3, C.powernet.avail * 0.01) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot. - C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock. + var/obj/O = AM + if(O.throwforce != 0)//don't want to let people spam tesla bolts, this way it will break after time + var/turf/T = get_turf(src) + var/obj/structure/cable/C = T.get_cable_node() + if(C) + playsound(src, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5) + tesla_zap(src, 3, C.powernet.avail * 0.01) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot. + C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock. return ..() /obj/structure/grille/get_dumping_location(datum/component/storage/source,mob/user)