From e7c5f8bf0c9d9e25f975f74429f77eb6e3b97594 Mon Sep 17 00:00:00 2001 From: HeadyBucket Date: Tue, 6 Jun 2017 23:12:50 +0100 Subject: [PATCH] Fix infinite glass exploit Fixes an exploit where glass can be infinitely made. simples. Also changed a list var and deleted two just because it stuck out for me. --- code/modules/power/lighting.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 3f42b4d58ce..366c9ee52af 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -122,6 +122,7 @@ fixture_type = "bulb" sheets_refunded = 1 + // the standard tube light fixture /obj/machinery/light name = "light fixture" @@ -149,6 +150,7 @@ // this is used to calc the probability the light burns out var/rigged = 0 // true if rigged to explode + var/lightmaterials = list(MAT_GLASS=100) //stores the materials the light is made of to stop infinite glass exploit // the smaller bulb light fixture @@ -305,6 +307,7 @@ brightness_range = L.brightness_range brightness_power = L.brightness_power brightness_color = L.brightness_color + lightmaterials = L.materials on = has_power() update() @@ -472,6 +475,7 @@ L.brightness_range = brightness_range L.brightness_power = brightness_power L.brightness_color = brightness_color + L.materials = lightmaterials // light item inherits the switchcount, then zero it L.switchcount = switchcount @@ -500,6 +504,7 @@ L.brightness_range = brightness_range L.brightness_power = brightness_power L.brightness_color = brightness_color + L.materials = lightmaterials // light item inherits the switchcount, then zero it L.switchcount = switchcount @@ -596,7 +601,7 @@ var/status = 0 // LIGHT_OK, LIGHT_BURNED or LIGHT_BROKEN var/base_state var/switchcount = 0 // number of times switched - materials = list(MAT_METAL=60) + materials = list(MAT_GLASS=100) var/rigged = 0 // true if rigged to explode var/brightness_range = 2 //how much light it gives off var/brightness_power = 1 @@ -608,7 +613,6 @@ icon_state = "ltube" base_state = "ltube" item_state = "c_tube" - materials = list(MAT_GLASS=100) brightness_range = 8 /obj/item/weapon/light/tube/large @@ -623,7 +627,6 @@ icon_state = "lbulb" base_state = "lbulb" item_state = "contvapour" - materials = list(MAT_GLASS=100) brightness_range = 5 brightness_color = "#a0a080" @@ -637,7 +640,6 @@ icon_state = "fbulb" base_state = "fbulb" item_state = "egg4" - materials = list(MAT_GLASS=100) brightness_range = 5 // update the icon state and description of the light