Hopefully fixes spectral blade letting ghosts stay visible (#17602)

This commit is contained in:
Luc
2022-04-12 15:53:37 +01:00
committed by GitHub
parent 43754c445b
commit 1b3b040ce5
2 changed files with 28 additions and 14 deletions
+9 -3
View File
@@ -78,6 +78,7 @@
orbit_data += new_comp.orbit_data
new_comp.orbiter_list = list()
new_comp.orbit_data = list()
QDEL_NULL(new_comp)
/datum/component/orbiter/PostTransfer()
if(!isatom(parent) || isarea(parent) || !get_turf(parent))
@@ -448,8 +449,9 @@
/**
* Check every object in the hierarchy above ourselves for orbiters, and return the full list of them.
* If an object is being held in a backpack, returns orbiters of the backpack, the person
* If recursive == TRUE, this will also check recursively through any ghosts seen to make sure we find *everything* upstream
*/
/atom/proc/get_orbiters_up_hierarchy(list/processed, source = TRUE)
/atom/proc/get_orbiters_up_hierarchy(list/processed, source = TRUE, recursive = FALSE)
var/list/output = list()
if(!processed)
processed = list()
@@ -459,10 +461,14 @@
processed += src
for(var/atom/movable/atom_orbiter in get_orbiters())
if(isobserver(atom_orbiter))
if(recursive)
output += atom_orbiter.get_orbiters_recursive()
output += atom_orbiter
if(atom_orbiter.loc != null)
output += atom_orbiter.loc.get_orbiters_up_hierarchy(processed, source = FALSE)
if(loc)
output += loc.get_orbiters_up_hierarchy(processed, source = FALSE)
return output
#undef ORBIT_LOCK_IN
#undef ORBIT_FORCE_MOVE