From 45c8aa5b162991951d1b99e02d6fc4ba0b36849b Mon Sep 17 00:00:00 2001 From: Leshana Date: Thu, 15 Feb 2018 20:11:04 -0500 Subject: [PATCH] Small Fixes and Refactor (#4819) * Fix not calling parent in fake gloves. * Refactor machinery.dm to use constants instead of bare numbers and strings. --- code/game/machinery/machinery.dm | 18 +++++++++--------- code/modules/clothing/gloves/color.dm | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index c616d1ee5b0..673e3663132 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -112,7 +112,7 @@ Class Procs: var/panel_open = 0 var/global/gl_uid = 1 var/interact_offline = 0 // Can the machine be interacted with while de-powered. - var/circuit = null + var/obj/item/weapon/circuitboard/circuit = null /obj/machinery/New(l, d=0) ..(l) @@ -402,7 +402,7 @@ Class Procs: if(A.frame_type.circuit) A.need_circuit = 0 - if(A.frame_type.frame_class == "machine") + if(A.frame_type.frame_class == FRAME_CLASS_MACHINE) for(var/obj/D in component_parts) D.forceMove(src.loc) if(A.components) @@ -412,15 +412,15 @@ Class Procs: component_parts = list() A.check_components() - if(A.frame_type.frame_class == "alarm") - A.state = 2 - else if(A.frame_type.frame_class == "computer" || A.frame_type.frame_class == "display") + if(A.frame_type.frame_class == FRAME_CLASS_ALARM) + A.state = FRAME_FASTENED + else if(A.frame_type.frame_class == FRAME_CLASS_COMPUTER || A.frame_type.frame_class == FRAME_CLASS_DISPLAY) if(stat & BROKEN) - A.state = 3 + A.state = FRAME_WIRED else - A.state = 4 + A.state = FRAME_PANELED else - A.state = 3 + A.state = FRAME_WIRED A.set_dir(dir) A.pixel_x = pixel_x @@ -430,4 +430,4 @@ Class Procs: M.loc = null M.deconstruct(src) qdel(src) - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index 370306539ae..ef9d0e713db 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -9,10 +9,11 @@ desc = "These gloves are cheap copies of proper insulated gloves. No way this can end badly." name = "budget insulated gloves" icon_state = "yellow" - siemens_coefficient = 1 //Set to a default of 1, gets overridden in New() + siemens_coefficient = 1 //Set to a default of 1, gets overridden in initialize() permeability_coefficient = 0.05 -/obj/item/clothing/gloves/fyellow/New() +/obj/item/clothing/gloves/fyellow/initialize() + . = ..() //Picks a value between 0 and 1, in 5% increments var/shock_pick = rand(0,20) siemens_coefficient = shock_pick * 0.05