From d6fdcd3d2c2c86b1427ac45b62e05670205dfade Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 7 Nov 2023 03:21:31 +0100 Subject: [PATCH] [MIRROR] Fix light eater affecting lava, space, openspace, and transparent turfs [MDB IGNORE] (#24826) * Fix light eater affecting lava, space, openspace, and transparent turfs (#79393) ## About The Pull Request Fixes #79388 Light eater element can no longer affect lava, space (starlight), openspace, or any turf with transparency. ## Why It's Good For The Game Better consistency. ## Changelog :cl: fix: Fix light eater affecting lava, space, openspace, and transparent turfs /:cl: * Fix light eater affecting lava, space, openspace, and transparent turfs --------- Co-authored-by: Tim --- code/datums/elements/light_eater.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/datums/elements/light_eater.dm b/code/datums/elements/light_eater.dm index b4f7cf1042f..50f88cb9e9b 100644 --- a/code/datums/elements/light_eater.dm +++ b/code/datums/elements/light_eater.dm @@ -4,6 +4,10 @@ * The temporary equivalent is [/datum/component/light_eater] */ /datum/element/light_eater + var/static/list/blacklisted_areas = typecacheof(list( + /turf/open/space, + /turf/open/lava, + )) /datum/element/light_eater/Attach(datum/target) if(isatom(target)) @@ -83,8 +87,9 @@ * - [eater][/datum]: The light eater eating the morsel. This is the datum that the element is attached to that started this chain. */ /datum/element/light_eater/proc/devour(atom/morsel, datum/eater) - var/static/list/undevourable = typecacheof(list(/turf/open/space)) - if(is_type_in_typecache(morsel, undevourable)) + if(is_type_in_typecache(morsel, blacklisted_areas)) + return FALSE + if(istransparentturf(morsel)) return FALSE if(morsel.light_power <= 0 || morsel.light_range <= 0 || !morsel.light_on) return FALSE