diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 659aae7c006..f6110b756cf 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -766,6 +766,12 @@ heat_exposure_stacks = 0 return ..() +/mob/living/carbon/human/is_nearsighted() + var/obj/item/clothing/glasses/eyewear = glasses + if(istype(eyewear) && eyewear.vision_correction) + return FALSE + return ..() + /mob/living/carbon/human/is_literate() return TRUE diff --git a/code/modules/mob/living/living_fov.dm b/code/modules/mob/living/living_fov.dm index a9776304d45..cb2b7f78a48 100644 --- a/code/modules/mob/living/living_fov.dm +++ b/code/modules/mob/living/living_fov.dm @@ -45,14 +45,7 @@ . = TRUE // Handling nearsightnedness - if(. && HAS_TRAIT(src, TRAIT_NEARSIGHT)) - //Checking if our dude really is suffering from nearsightness! (very nice nearsightness code) - if(iscarbon(src)) - var/mob/living/carbon/carbon_me = src - if(carbon_me.glasses) - var/obj/item/clothing/glasses/glass = carbon_me.glasses - if(glass.vision_correction) - return + if(. && is_nearsighted()) if((rel_x >= NEARSIGHTNESS_FOV_BLINDNESS || rel_x <= -NEARSIGHTNESS_FOV_BLINDNESS) || (rel_y >= NEARSIGHTNESS_FOV_BLINDNESS || rel_y <= -NEARSIGHTNESS_FOV_BLINDNESS)) return FALSE diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index faf47cc827b..467e5290158 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1144,6 +1144,10 @@ /mob/proc/has_nightvision() return see_in_dark >= NIGHTVISION_FOV_RANGE +/// Is this mob affected by nearsight +/mob/proc/is_nearsighted() + return HAS_TRAIT(src, TRAIT_NEARSIGHT) + /// This mob is abile to read books /mob/proc/is_literate() return FALSE