From 5e5bdec85d6ae74927023e64e7ede9b85f33e7a5 Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Mon, 16 Mar 2020 01:55:02 +0100
Subject: [PATCH] More runtime errors.
---
code/datums/diseases/transformation.dm | 12 ++++++------
code/game/objects/items/stacks/stack.dm | 3 ++-
code/modules/mob/living/carbon/human/species.dm | 4 ++--
code/modules/surgery/organs/eyes.dm | 2 ++
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm
index 36c7d70f3c..430b7e07b0 100644
--- a/code/datums/diseases/transformation.dm
+++ b/code/datums/diseases/transformation.dm
@@ -32,16 +32,16 @@
..()
switch(stage)
if(1)
- if (prob(stage_prob) && stage1)
+ if (prob(stage_prob) && length(stage1))
to_chat(affected_mob, pick(stage1))
if(2)
- if (prob(stage_prob) && stage2)
+ if (prob(stage_prob) && length(stage2))
to_chat(affected_mob, pick(stage2))
if(3)
- if (prob(stage_prob*2) && stage3)
+ if (prob(stage_prob*2) && length(stage3))
to_chat(affected_mob, pick(stage3))
if(4)
- if (prob(stage_prob*2) && stage4)
+ if (prob(stage_prob*2) && length(stage4))
to_chat(affected_mob, pick(stage4))
if(5)
do_disease_transformation(affected_mob)
@@ -162,7 +162,7 @@
desc = "This disease, actually acute nanomachine infection, converts the victim into a cyborg."
severity = DISEASE_SEVERITY_BIOHAZARD
visibility_flags = 0
- stage1 = list()
+ stage1 = null
stage2 = list("Your joints feel stiff.", "Beep...boop..")
stage3 = list("Your joints feel very stiff.", "Your skin feels loose.", "You can feel something move...inside.")
stage4 = list("Your skin feels very loose.", "You can feel... something...inside you.")
@@ -195,7 +195,7 @@
desc = "This disease changes the victim into a xenomorph."
severity = DISEASE_SEVERITY_BIOHAZARD
visibility_flags = 0
- stage1 = list()
+ stage1 = null
stage2 = list("Your throat feels scratchy.", "Kill...")
stage3 = list("Your throat feels very scratchy.", "Your skin feels tight.", "You can feel something move...inside.")
stage4 = list("Your skin feels very tight.", "Your blood boils!", "You can feel... something...inside you.")
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index f707c02ce9..5f2795c857 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -219,8 +219,9 @@
O = new R.result_type(usr.drop_location())
if(O)
O.setDir(usr.dir)
+ log_craft("[O] crafted by [usr] at [loc_name(O.loc)]")
+
use(R.req_amount * multiplier)
- log_craft("[O] crafted by [usr] at [loc_name(O.loc)]")
if(R.applies_mats && custom_materials && custom_materials.len)
var/list/used_materials = list()
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index b428f49578..fc2817f134 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -397,7 +397,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(I.flags_inv & HIDEFACIALHAIR)
facialhair_hidden = TRUE
- if(H.wear_mask)
+ if(H.wear_mask && istype(H.wear_mask))
var/obj/item/clothing/mask/M = H.wear_mask
dynamic_fhair_suffix = M.dynamic_fhair_suffix //mask > head in terms of facial hair
if(M.flags_inv & HIDEFACIALHAIR)
@@ -451,7 +451,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(I.flags_inv & HIDEHAIR)
hair_hidden = TRUE
- if(H.wear_mask)
+ if(H.wear_mask && istype(H.wear_mask))
var/obj/item/clothing/mask/M = H.wear_mask
if(!dynamic_hair_suffix) //head > mask in terms of head hair
dynamic_hair_suffix = M.dynamic_hair_suffix
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index a915d12838..6b93995e62 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -319,6 +319,8 @@
on_mob.forceMove(scanning)
for(var/i in 1 to light_beam_distance)
scanning = get_step(scanning, scandir)
+ if(!scanning)
+ break
if(scanning.opacity || scanning.has_opaque_atom)
stop = TRUE
var/obj/effect/abstract/eye_lighting/L = LAZYACCESS(eye_lighting, i)