diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 0a9ecad292..92f18afcc1 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,7 +1,6 @@ /obj/item/clothing name = "clothing" var/list/species_restricted = null //Only these species can wear this kit. - var/gas_filter_strength = 0 //For gas mask filters //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 44bf751967..b89b8831af 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -9,7 +9,7 @@ gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 siemens_coefficient = 0.9 - gas_filter_strength = 1 + var/gas_filter_strength = 1 //For gas mask filters //Plague Dr suit can be found in clothing/suits/bio.dm /obj/item/clothing/mask/gas/plaguedoctor diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index d514a4f95b..0164ca1227 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -334,10 +334,14 @@ if(head.flags & BLOCK_GAS_SMOKE_EFFECT) block = 1 - if(!block && !wear_mask) - breath = loc.remove_air(breath_moles, 0) + if(block && wear_mask) + if(istype(wear_mask, /obj/item/clothing/mask/gas)) + var/obj/item/clothing/mask/gas/G = wear_mask + breath = loc.remove_air(breath_moles, G.gas_filter_strength) //Filters out harmful gases + else + breath = loc.remove_air(breath_moles, 0) else - breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases + breath = loc.remove_air(breath_moles, 0) if(!is_lung_ruptured()) if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 84228208c9..be549e2c62 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -232,13 +232,16 @@ if(istype(wear_mask, /obj/item/clothing/mask/gas)) block = 1 - if(!block) - breath = loc.remove_air(breath_moles, 0) + if(block && wear_mask) + if(istype(wear_mask, /obj/item/clothing/mask/gas)) + var/obj/item/clothing/mask/gas/G = wear_mask + breath = loc.remove_air(breath_moles, G.gas_filter_strength) //Filters out harmful gases + else + breath = loc.remove_air(breath_moles, 0) else - breath = loc.remove_air(breath_moles, wear_mask.gas_filter_strength) //Filters out harmful gases + breath = loc.remove_air(breath_moles, 0) if(!block) - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) if(smoke.reagents.total_volume) smoke.reagents.reaction(src, INGEST)