From dbace8563507e8d3917c2b33ba2e8c73090b8cc2 Mon Sep 17 00:00:00 2001
From: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Date: Sat, 25 Jul 2020 04:56:49 -0400
Subject: [PATCH 1/2] Fixes clothes repair for real (#52379)
* fixes clothing fixing
* per roh
* durr
---
code/modules/clothing/clothing.dm | 37 ++++++++++++++++++-------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 6b8f78f823c..303376e955e 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -93,21 +93,28 @@
return ..()
/obj/item/clothing/attackby(obj/item/W, mob/user, params)
- if(damaged_clothes && istype(W, repairable_by))
- var/obj/item/stack/S = W
- switch(damaged_clothes)
- if(CLOTHING_DAMAGED)
- S.use(1)
- repair(user, params)
- if(CLOTHING_SHREDDED)
- if(S.amount < 3)
- to_chat(user, "You require 3 [S.name] to repair [src].")
- return
- to_chat(user, "You begin fixing the damage to [src] with [S]...")
- if(do_after(user, 6 SECONDS, TRUE, src))
- if(S.use(3))
- repair(user, params)
- return 1
+ if(!istype(W, repairable_by))
+ return ..()
+
+ switch(damaged_clothes)
+ if(CLOTHING_PRISTINE)
+ return..()
+ if(CLOTHING_DAMAGED)
+ var/obj/item/stack/cloth_repair = W
+ cloth_repair.use(1)
+ repair(user, params)
+ return TRUE
+ if(CLOTHING_SHREDDED)
+ var/obj/item/stack/cloth_repair = W
+ if(cloth_repair.amount < 3)
+ to_chat(user, "You require 3 [cloth_repair.name] to repair [src].")
+ return TRUE
+ to_chat(user, "You begin fixing the damage to [src] with [cloth_repair]...")
+ if(!do_after(user, 6 SECONDS, TRUE, src) || !cloth_repair.use(3))
+ return TRUE
+ repair(user, params)
+ return TRUE
+
return ..()
/// Set the clothing's integrity back to 100%, remove all damage to bodyparts, and generally fix it up