Updates the proximity monitor component (#15836)

* prox component update

* mochi review

* bug fix, makes proximity sensors always active

* GC fixes and removes an unused proc

* Disposal fixes from TM

* fixes runtimes when objects created in nullspace runtimes, fixes portable flasher

* a fresh perspective

* lewcc review

* adds comment about direct loc setting over forceMove
This commit is contained in:
SteelSlayer
2022-04-30 09:50:36 -05:00
committed by GitHub
parent da5ef366f1
commit e49b016df4
16 changed files with 524 additions and 145 deletions
+22
View File
@@ -530,6 +530,28 @@
if(C.can_transfer)
target.TakeComponent(comps)
/**
* Transfer a single component from the source datum, to the target.
*
* Arguments:
* * datum/target - the target to move the component to
* * component_instance_or_typepath - either an already created component, or a component typepath
*/
/datum/proc/TransferComponent(datum/target, component_instance_or_typepath)
if(!datum_components)
return
// If the proc was fed a typepath.
var/datum/component/comp = datum_components[component_instance_or_typepath]
if(comp?.can_transfer)
target.TakeComponent(comp)
return
// if the proc was fed a component instance.
for(var/component in datum_components)
var/datum/component/C = datum_components[component]
if(istype(C, component_instance_or_typepath) && C.can_transfer)
target.TakeComponent(C)
return
/**
* Return the object that is the host of any UI's that this component has
*/