[MIRROR] Adds a method to transfer all components from one datum to another (#3661)
* Merge pull request #31941 from tgstation/Cyberboss-patch-2 Adds a method to transfer all components from one datum to another * Adds a method to transfer all components from one datum to another
This commit is contained in:
committed by
kevinz000
parent
99e4db7bf4
commit
1265e804c5
@@ -220,3 +220,14 @@
|
||||
C.OnTransfer(src)
|
||||
C.parent = src
|
||||
SendSignal(COMSIG_COMPONENT_ADDED, C)
|
||||
|
||||
/datum/proc/TransferComponents(datum/target)
|
||||
var/list/dc = datum_components
|
||||
if(!dc)
|
||||
return
|
||||
var/comps = dc[/datum/component]
|
||||
if(islist(comps))
|
||||
for(var/I in comps)
|
||||
target.TakeComponent(I)
|
||||
else
|
||||
target.TakeComponent(comps)
|
||||
|
||||
Reference in New Issue
Block a user