You brought this upon yourself botany (#21117)

This commit is contained in:
Vi3trice
2023-06-02 13:13:03 -04:00
committed by GitHub
parent c0e19a8e24
commit 578609b42a
3 changed files with 10 additions and 2 deletions

View File

@@ -32,7 +32,10 @@
/datum/light_source/New(atom/owner, atom/top)
source_atom = owner // Set our new owner.
LAZYADD(source_atom.light_sources, src)
top_atom = top
if(top.flags_2 & BLOCKS_LIGHT_2) // If the top atom blocks light, then our owner becomes the topmost instead. This still allows atoms that block light to be a light of their own.
top_atom = source_atom
else
top_atom = top
if(top_atom != source_atom)
LAZYADD(top_atom.light_sources, src)
@@ -77,7 +80,10 @@
if(top_atom != source_atom && top_atom.light_sources) // Remove ourselves from the light sources of that top atom.
LAZYREMOVE(top_atom.light_sources, src)
top_atom = new_top_atom
if(new_top_atom.flags_2 & BLOCKS_LIGHT_2)
top_atom = source_atom
else
top_atom = new_top_atom
if(top_atom != source_atom)
LAZYADD(top_atom.light_sources, src) // Add ourselves to the light sources of our new top atom.