From 3707118ebc1070a192ffd03bcca9c2a06726b6be Mon Sep 17 00:00:00 2001 From: Geeves Date: Sat, 20 May 2023 17:34:04 +0200 Subject: [PATCH] Nearsighted Sensors Fix (#16338) --- code/__defines/traits.dm | 2 ++ code/modules/mob/living/carbon/human/human_helpers.dm | 2 +- code/modules/overmap/ships/computers/ship.dm | 3 +++ html/changelogs/geeves-nearsighted_dominians.yml | 6 ++++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/geeves-nearsighted_dominians.yml diff --git a/code/__defines/traits.dm b/code/__defines/traits.dm index aac0dde6e1f..6f189f611e4 100644 --- a/code/__defines/traits.dm +++ b/code/__defines/traits.dm @@ -142,6 +142,8 @@ /// lets mobs that traditionally don't hallucinate, hallucinate #define TRAIT_BYPASS_HALLUCINATION_RESTRICTION "bypassing_hallucination_restriction" +/// when mobs are viewing something via a computer, currently used for the helm computer +#define TRAIT_COMPUTER_VIEW "computer_view" // IPC OVERLOADER OVERDOSE STATES #define TRAIT_SOURCE_OVERLOADER "overloader" diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 1dcb52f5112..bf9dee248dc 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -56,7 +56,7 @@ else binoc_check = TRUE - if ((!client || client.eye == src || client.eye == loc || client.eye == z_eye) && binoc_check) // !client is so the unit tests function + if(((!client || client.eye == src || client.eye == loc || client.eye == z_eye) && binoc_check) || HAS_TRAIT(src, TRAIT_COMPUTER_VIEW)) // !client is so the unit tests function if(istype(src.head, /obj/item/clothing/head)) add_clothing_protection(head) if(istype(src.glasses, /obj/item/clothing/glasses)) diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index cbb572b6917..64206b86417 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -58,6 +58,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov LAZYDISTINCTADD(viewers, WEAKREF(user)) if(linked) LAZYDISTINCTADD(linked.navigation_viewers, WEAKREF(user)) + ADD_TRAIT(user, TRAIT_COMPUTER_VIEW, ref(src)) /obj/machinery/computer/ship/proc/unlook(var/mob/user) user.reset_view() @@ -87,6 +88,8 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov for(var/obj/machinery/computer/ship/sensors/sensor in linked.consoles) sensor.hide_contacts(user) + REMOVE_TRAIT(user, TRAIT_COMPUTER_VIEW, ref(src)) + /obj/machinery/computer/ship/proc/viewing_overmap(mob/user) return (WEAKREF(user) in viewers) || (linked && (WEAKREF(user) in linked.navigation_viewers)) diff --git a/html/changelogs/geeves-nearsighted_dominians.yml b/html/changelogs/geeves-nearsighted_dominians.yml new file mode 100644 index 00000000000..f7bb4cdad91 --- /dev/null +++ b/html/changelogs/geeves-nearsighted_dominians.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Nearsighted characters now have working vision on sensors / helm as long as they have their prescription glasses on." \ No newline at end of file