From 5a4fb02fc63fb9b2f94e42b1cee3f02ee77d4bf5 Mon Sep 17 00:00:00 2001
From: ShiftyRail <31417754+ShiftyRail@users.noreply.github.com>
Date: Sat, 14 Oct 2017 23:10:38 +0200
Subject: [PATCH] Collapse the if as PJB suggested
It is not possible to change the if(isplamsaman()) because mob doesn't have a species.
---
code/modules/clothing/clothing.dm | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 536995a0014..a46d5b81895 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -219,19 +219,21 @@
armor[A] -= rand(armor[A]/3, armor[A])
/obj/item/clothing/attack(var/mob/living/M, var/mob/living/user, def_zone, var/originator = null)
- if(iscarbon(user))
- if(user.a_intent == I_HELP && (istype(src, /obj/item/clothing/under) || (istype(src, /obj/item/clothing/suit) && !istype(src, /obj/item/clothing/suit/space))))
- if(ishuman(M) && M.on_fire)
- var/mob/living/carbon/human/target = M
- if(isplasmaman(target)) // Cannot put out plasmamen, else they could just go around with a jumpsuit and not need a space suit.
- visible_message("\The [user] attempts to put out the fire on \the [target], but plasmafires are too hot. It is no use.")
- else
- visible_message("\The [user] attempts to put out the fire on \the [target] with \the [src].")
- if(prob(extinguishingProb))
- M.ExtinguishMob()
- visible_message("\The [user] puts out the fire on \the [target].")
- return
- ..()
+ if (!(iscarbon(user) \
+ && user.a_intent == I_HELP \
+ && (istype(src, /obj/item/clothing/under) || (istype(src, /obj/item/clothing/suit) && !istype(src, /obj/item/clothing/suit/space))) \
+ && ishuman(M) && M.on_fire))
+ ..()
+ else
+ var/mob/living/carbon/human/target = M
+ if(isplasmaman(target)) // Cannot put out plasmamen, else they could just go around with a jumpsuit and not need a space suit.
+ visible_message("\The [user] attempts to put out the fire on \the [target], but plasmafires are too hot. It is no use.")
+ else
+ visible_message("\The [user] attempts to put out the fire on \the [target] with \the [src].")
+ if(prob(extinguishingProb))
+ M.ExtinguishMob()
+ visible_message("\The [user] puts out the fire on \the [target].")
+ return
//Ears: headsets, earmuffs and tiny objects
/obj/item/clothing/ears