mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
[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 <TemporalOroboros@gmail.com>
This commit is contained in:
co-authored by
TemporalOroboros
parent
5ea12d4677
commit
5387f7e1b7
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user