mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-19 20:07:05 +01:00
Add null checks
This commit is contained in:
@@ -91,7 +91,7 @@
|
||||
//Second link in a breath chain, calls check_breath()
|
||||
/mob/living/carbon/proc/breathe()
|
||||
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
|
||||
if(reagents.has_reagent(/datum/reagent/toxin/lexorin))
|
||||
if(reagents?.has_reagent(/datum/reagent/toxin/lexorin))
|
||||
return
|
||||
if(istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
|
||||
return
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
//CRIT
|
||||
if(!breath || (breath.total_moles() == 0) || !lungs)
|
||||
if(reagents.has_reagent(/datum/reagent/medicine/epinephrine) && lungs)
|
||||
if(reagents?.has_reagent(/datum/reagent/medicine/epinephrine) && lungs)
|
||||
return
|
||||
adjustOxyLoss(1)
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
return
|
||||
|
||||
// No decay if formaldehyde in corpse or when the corpse is charred
|
||||
if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK))
|
||||
if(reagents?.has_reagent(/datum/reagent/toxin/formaldehyde, 15) || HAS_TRAIT(src, TRAIT_HUSK))
|
||||
return
|
||||
|
||||
// Also no decay if corpse chilled or not organic/undead
|
||||
@@ -432,7 +432,7 @@
|
||||
if(O)
|
||||
O.on_life()
|
||||
else
|
||||
if(reagents.has_reagent(/datum/reagent/toxin/formaldehyde, 1)) // No organ decay if the body contains formaldehyde.
|
||||
if(reagents?.has_reagent(/datum/reagent/toxin/formaldehyde, 1)) // No organ decay if the body contains formaldehyde.
|
||||
return
|
||||
for(var/V in internal_organs)
|
||||
var/obj/item/organ/O = V
|
||||
|
||||
Reference in New Issue
Block a user