From 2b5695b39e2949599ce22d868a072c518e819fd4 Mon Sep 17 00:00:00 2001 From: Sierra Helper <125094432+SierraHelper@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:59:12 +0300 Subject: [PATCH] [MIRROR] Fix Eyeglow Layering (#2962) Co-authored-by: SierraKomodo <11140088+SierraKomodo@users.noreply.github.com> Co-authored-by: Lexanx <61974560+Lexanx@users.noreply.github.com> --- code/modules/organs/external/head.dm | 16 ++++++++++++---- code/modules/organs/external/species/diona.dm | 18 ++++++++++++------ .../organs/external/species/nabber_stance.dm | 10 ++++++++-- code/modules/organs/internal/eyes.dm | 5 +---- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/code/modules/organs/external/head.dm b/code/modules/organs/external/head.dm index 6c47e8ab0bc66..0b0e66894582e 100644 --- a/code/modules/organs/external/head.dm +++ b/code/modules/organs/external/head.dm @@ -25,10 +25,18 @@ var/graffiti_style /obj/item/organ/external/head/proc/get_eye_overlay() - if(glowing_eyes && owner) - var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[owner.species.vision_organ ? owner.species.vision_organ : BP_EYES] - if(eyes) - return eyes.get_special_overlay() + if (!glowing_eyes || !owner) + return + + var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[owner.species.vision_organ ? owner.species.vision_organ : BP_EYES] + if (!eyes) + return + + for (var/obj/item/equipped as anything in owner.get_equipped_items()) + if (HAS_FLAGS(equipped.body_parts_covered, EYES)) + return + + return eyes.get_special_overlay() /obj/item/organ/external/head/proc/get_eyes() var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[owner.species.vision_organ ? owner.species.vision_organ : BP_EYES] diff --git a/code/modules/organs/external/species/diona.dm b/code/modules/organs/external/species/diona.dm index 204a5dfc56aa8..102da1207e897 100644 --- a/code/modules/organs/external/species/diona.dm +++ b/code/modules/organs/external/species/diona.dm @@ -127,13 +127,19 @@ var/eye_icon_location = 'icons/mob/human_races/species/diona/eyes.dmi' /obj/item/organ/external/head/diona/get_eye_overlay() + if (!glowing_eyes) + return + + for (var/obj/item/equipped as anything in owner.get_equipped_items()) + if (HAS_FLAGS(equipped.body_parts_covered, EYES)) + return + var/icon/I = get_eyes() - if(glowing_eyes) - var/image/eye_glow = image(I) - eye_glow.AddOverlays(emissive_appearance(eye_icon_location, "")) - eye_glow.layer = FLOAT_LAYER - //eye_glow.plane = EFFECTS_ABOVE_LIGHTING_PLANE - return eye_glow + var/image/eye_glow = image(I) + eye_glow.AddOverlays(emissive_appearance(eye_icon_location, "")) + eye_glow.layer = FLOAT_LAYER + //eye_glow.plane = EFFECTS_ABOVE_LIGHTING_PLANE + return eye_glow /obj/item/organ/external/head/diona/get_eyes() return icon(icon = eye_icon_location, icon_state = "") diff --git a/code/modules/organs/external/species/nabber_stance.dm b/code/modules/organs/external/species/nabber_stance.dm index c77f43f025f6a..bcfb5571336c6 100644 --- a/code/modules/organs/external/species/nabber_stance.dm +++ b/code/modules/organs/external/species/nabber_stance.dm @@ -6,8 +6,14 @@ /obj/item/organ/external/head/insectoid/nabber/get_eye_overlay() var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[owner.species.vision_organ ? owner.species.vision_organ : BP_EYES] - if(eyes) - return eyes.get_special_overlay() + if (!eyes) + return + + for (var/obj/item/equipped as anything in owner.get_equipped_items()) + if (HAS_FLAGS(equipped.body_parts_covered, EYES)) + return + + return eyes.get_special_overlay() /obj/item/organ/external/head/insectoid/nabber/refresh_action_button() . = ..() diff --git a/code/modules/organs/internal/eyes.dm b/code/modules/organs/internal/eyes.dm index 369c715049785..62789bf392add 100644 --- a/code/modules/organs/internal/eyes.dm +++ b/code/modules/organs/internal/eyes.dm @@ -38,10 +38,7 @@ if(I) var/cache_key = "[last_eye_cache_key]-glow" if(!human_icon_cache[cache_key]) - var/image/eye_glow = image(I) - eye_glow.layer = EYE_GLOW_LAYER - eye_glow.plane = EFFECTS_ABOVE_LIGHTING_PLANE - human_icon_cache[cache_key] = eye_glow + human_icon_cache[cache_key] = emissive_appearance(I) return human_icon_cache[cache_key] /obj/item/organ/internal/eyes/proc/change_eye_color()