From 24aa63c8125ecba71732a492de72f7062acdff6a Mon Sep 17 00:00:00 2001 From: SamCroswell Date: Mon, 28 Dec 2015 09:55:13 -0500 Subject: [PATCH] Adds darkness_view to helmets --- code/modules/clothing/clothing.dm | 1 + code/modules/mob/living/carbon/human/species/species.dm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 362d60e8dd9..f462bce2ee2 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -264,6 +264,7 @@ BLIND // can't see anything var/flash_protect = 0 var/tint = 0 var/HUDType = null + var/darkness_view = 0 var/vision_flags = 0 var/see_darkness = 1 diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index bf0702f5f9e..6cff7f5f7a0 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -413,6 +413,7 @@ if(H.client) H.client.screen += global_hud.darkMask + var/minimum_darkness_view = INFINITY if(H.glasses) if(istype(H.glasses, /obj/item/clothing/glasses)) var/obj/item/clothing/glasses/G = H.glasses @@ -420,6 +421,7 @@ if(G.darkness_view) H.see_in_dark = G.darkness_view + minimum_darkness_view = G.darkness_view if(!G.see_darkness) H.see_invisible = SEE_INVISIBLE_MINIMUM @@ -437,6 +439,9 @@ var/obj/item/clothing/head/hat = H.head H.sight |= hat.vision_flags + if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. + H.see_in_dark = hat.darkness_view + if(!hat.see_darkness) H.see_invisible = SEE_INVISIBLE_MINIMUM