From 5387f7e1b70ea2af074a5aff08a7dbf8f26da0b4 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 29 Mar 2021 23:36:42 +0200 Subject: [PATCH] [MIRROR] Fixes the light eater not eating lights people are holding. (#4518) * Fixes lights on people (#58000) - Fixes light eaters not putting out lights on people. * Fixes the light eater not eating lights people are holding. Co-authored-by: TemporalOroboros --- code/datums/components/overlay_lighting.dm | 11 +++++++---- code/datums/elements/light_eater.dm | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/datums/components/overlay_lighting.dm b/code/datums/components/overlay_lighting.dm index e5cf6d87a7c..b2268448a91 100644 --- a/code/datums/components/overlay_lighting.dm +++ b/code/datums/components/overlay_lighting.dm @@ -212,15 +212,17 @@ parent_attached_to = new_parent_attached_to if(.) var/atom/movable/old_parent_attached_to = . - UnregisterSignal(old_parent_attached_to, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED)) + UnregisterSignal(old_parent_attached_to, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED, COMSIG_LIGHT_EATER_QUEUE)) if(old_parent_attached_to == current_holder) RegisterSignal(old_parent_attached_to, COMSIG_PARENT_QDELETING, .proc/on_holder_qdel) RegisterSignal(old_parent_attached_to, COMSIG_MOVABLE_MOVED, .proc/on_holder_moved) + RegisterSignal(old_parent_attached_to, COMSIG_LIGHT_EATER_QUEUE, .proc/on_light_eater) if(parent_attached_to) if(parent_attached_to == current_holder) - UnregisterSignal(current_holder, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED)) + UnregisterSignal(current_holder, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED, COMSIG_LIGHT_EATER_QUEUE)) RegisterSignal(parent_attached_to, COMSIG_PARENT_QDELETING, .proc/on_parent_attached_to_qdel) RegisterSignal(parent_attached_to, COMSIG_MOVABLE_MOVED, .proc/on_parent_attached_to_moved) + RegisterSignal(parent_attached_to, COMSIG_LIGHT_EATER_QUEUE, .proc/on_light_eater) check_holder() @@ -230,7 +232,7 @@ return if(current_holder) if(current_holder != parent && current_holder != parent_attached_to) - UnregisterSignal(current_holder, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED)) + UnregisterSignal(current_holder, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED, COMSIG_LIGHT_EATER_QUEUE)) if(directional) UnregisterSignal(current_holder, COMSIG_ATOM_DIR_CHANGE) if(overlay_lighting_flags & LIGHTING_ON) @@ -242,6 +244,7 @@ if(new_holder != parent && new_holder != parent_attached_to) RegisterSignal(new_holder, COMSIG_PARENT_QDELETING, .proc/on_holder_qdel) RegisterSignal(new_holder, COMSIG_MOVABLE_MOVED, .proc/on_holder_moved) + RegisterSignal(new_holder, COMSIG_LIGHT_EATER_QUEUE, .proc/on_light_eater) if(directional) RegisterSignal(new_holder, COMSIG_ATOM_DIR_CHANGE, .proc/on_holder_dir_change) if(overlay_lighting_flags & LIGHTING_ON) @@ -467,7 +470,7 @@ /// Handles putting the source for overlay lights into the light eater queue since we aren't tracked by [/atom/var/light_sources] /datum/component/overlay_lighting/proc/on_light_eater(datum/source, list/light_queue, datum/light_eater) SIGNAL_HANDLER - light_queue += parent + light_queue[parent] = TRUE return NONE #undef LIGHTING_ON diff --git a/code/datums/elements/light_eater.dm b/code/datums/elements/light_eater.dm index 4ef62744839..daf38a83ab2 100644 --- a/code/datums/elements/light_eater.dm +++ b/code/datums/elements/light_eater.dm @@ -69,7 +69,7 @@ SEND_SIGNAL(commisary, COMSIG_LIGHT_EATER_QUEUE, ., devourer) for(var/nom in commisary.light_sources) var/datum/light_source/morsel = nom - . += morsel.source_atom + .[morsel.source_atom] = TRUE /** * Consumes the light on the target, permanently rendering it incapable of producing light