mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user