From 81113310948912c92b5ec1e49df878ec39953261 Mon Sep 17 00:00:00 2001 From: lass9030 Date: Tue, 9 Oct 2018 16:21:11 +0200 Subject: [PATCH 1/2] Replaced code with procs, added return values. --- code/game/objects/items/weapons/lighters.dm | 2 ++ code/modules/clothing/clothing.dm | 10 ++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/weapons/lighters.dm b/code/game/objects/items/weapons/lighters.dm index cca83a3917b..ac8c7d04a95 100644 --- a/code/game/objects/items/weapons/lighters.dm +++ b/code/game/objects/items/weapons/lighters.dm @@ -183,6 +183,7 @@ attack_verb = list("burnt","singed") processing_objects.Add(src) update_icon() + return TRUE /obj/item/match/proc/matchburnout() if(lit) @@ -196,6 +197,7 @@ desc = "A match. This one has seen better days." attack_verb = list("flicked") processing_objects.Remove(src) + return TRUE /obj/item/match/dropped(mob/user) matchburnout() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 50872791f59..4ea3bfaab15 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -385,15 +385,9 @@ BLIND // can't see anything /obj/item/clothing/shoes/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/match) && src.loc == user) var/obj/item/match/M = I - if(!M.lit) // Match isn't lit, but isn't burnt. - M.lit = 1 - M.icon_state = "match_lit" - processing_objects.Add(M) - M.update_icon() + if(M.matchignite()) // Match isn't lit, but isn't burnt. user.visible_message("[user] strikes a [M] on the bottom of [src], lighting it.","You strike the [M] on the bottom of [src] to light it.") - playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1) - else if(M.lit == 1) // Match is lit, not extinguished. - M.dropped() + else if(M.matchburnout()) // Match is lit, not extinguished. user.visible_message("[user] crushes the [M] into the bottom of [src], extinguishing it.","You crush the [M] into the bottom of [src], extinguishing it.") else // Match has been previously lit and extinguished. to_chat(user, "The [M] has already been extinguished.") From b853f2e28cc63c03cc277a4165fa10f602f1accd Mon Sep 17 00:00:00 2001 From: lass9030 Date: Tue, 9 Oct 2018 18:22:54 +0200 Subject: [PATCH 2/2] Changed as requested, re-added sound. --- code/modules/clothing/clothing.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 4ea3bfaab15..bc6f7259ebc 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -387,10 +387,10 @@ BLIND // can't see anything var/obj/item/match/M = I if(M.matchignite()) // Match isn't lit, but isn't burnt. user.visible_message("[user] strikes a [M] on the bottom of [src], lighting it.","You strike the [M] on the bottom of [src] to light it.") - else if(M.matchburnout()) // Match is lit, not extinguished. + playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1) + else user.visible_message("[user] crushes the [M] into the bottom of [src], extinguishing it.","You crush the [M] into the bottom of [src], extinguishing it.") - else // Match has been previously lit and extinguished. - to_chat(user, "The [M] has already been extinguished.") + M.dropped() return if(istype(I, /obj/item/wirecutters))