From a1e278e978e811f738f4a21278ebdab8d0dc106c Mon Sep 17 00:00:00 2001 From: Datraen Date: Wed, 13 Jul 2016 21:59:34 -0400 Subject: [PATCH] Fixes #1144 Parses text rather than saving icon strings. Might be better to save the strings in the future into variables, done at the toggle level for custom items. --- code/modules/clothing/clothing.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 524302182e..f22df6a257 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -191,13 +191,15 @@ set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return + + var/base_icon = copytext(icon_state,1,(length(icon_state) - 3 + headphones_on)) if(headphones_on) - icon_state = "headphones_off" + icon_state = "[base_icon]_off" headphones_on = 0 usr << "You turn the music off." else - icon_state = "headphones_on" + icon_state = "[base_icon]_on" headphones_on = 1 usr << "You turn the music on."