Fixes clothes repair for real (#52379)

* fixes clothing fixing

* per roh

* durr
This commit is contained in:
Ryll Ryll
2020-07-25 04:57:04 -04:00
committed by SkyratBot
parent cf47c08045
commit dbace85635
+22 -15
View File
@@ -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, "<span class='warning'>You require 3 [S.name] to repair [src].</span>")
return
to_chat(user, "<span class='notice'>You begin fixing the damage to [src] with [S]...</span>")
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, "<span class='warning'>You require 3 [cloth_repair.name] to repair [src].</span>")
return TRUE
to_chat(user, "<span class='notice'>You begin fixing the damage to [src] with [cloth_repair]...</span>")
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