From 9e5e81325ea36050dc22f39303880c0776bed04f Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Thu, 12 Nov 2015 17:47:33 -0800 Subject: [PATCH] Fix Vision code weirdness --- code/modules/clothing/glasses/glasses.dm | 2 +- .../living/carbon/human/species/species.dm | 29 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 5ca60bea7f0..eaf73f5cd61 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -53,6 +53,7 @@ vision_flags = SEE_TURFS prescription_upgradable = 1 species_fit = list("Vox") + see_darkness = 0 //don't render darkness while wearing mesons sprite_sheets = list( "Vox" = 'icons/mob/species/vox/eyes.dmi' ) @@ -63,7 +64,6 @@ icon_state = "nvgmeson" item_state = "glasses" darkness_view = 8 - see_darkness = 0 prescription_upgradable = 0 /obj/item/clothing/glasses/meson/prescription diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 56d63785db1..b5c3ea39400 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -376,18 +376,25 @@ else H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) + H.see_in_dark = darksight //set their variables to default, modify them later + H.see_invisible = SEE_INVISIBLE_LIVING + if(H.mind && H.mind.vampire) if(VAMP_VISION in H.mind.vampire.powers && !(VAMP_FULL in H.mind.vampire.powers)) H.sight |= SEE_MOBS + else if(VAMP_FULL in H.mind.vampire.powers) H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + H.see_invisible = SEE_INVISIBLE_MINIMUM + if(XRAY in H.mutations) H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + + H.see_invisible = SEE_INVISIBLE_MINIMUM + if(H.seer == 1) var/obj/effect/rune/R = locate() in H.loc @@ -397,11 +404,7 @@ H.see_invisible = SEE_INVISIBLE_LIVING H.seer = 0 - else if(!H.seer) - H.see_in_dark = darksight - H.see_invisible = SEE_INVISIBLE_LIVING - - // This checks how much the mob's eyewear impairs their vision + //This checks how much the mob's eyewear impairs their vision if(H.tinttotal >= TINT_IMPAIR) if(tinted_weldhelh) if(H.tinttotal >= TINT_BLIND) @@ -413,7 +416,9 @@ if(istype(H.glasses, /obj/item/clothing/glasses)) var/obj/item/clothing/glasses/G = H.glasses H.sight |= G.vision_flags - H.see_in_dark = G.darkness_view + + if(G.darkness_view) + H.see_in_dark = G.darkness_view if(!G.see_darkness) H.see_invisible = SEE_INVISIBLE_MINIMUM @@ -442,6 +447,14 @@ if(ANTAGHUD) process_antag_hud(H) + + if(H.vision_type) + H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) + H.see_invisible = H.vision_type.see_invisible + if(H.vision_type.light_sensitive) + H.weakeyes = 1 + H.sight |= H.vision_type.sight_flags + if(H.see_override) //Override all H.see_invisible = H.see_override