[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:
CitadelStationBot
2017-10-28 03:19:48 -05:00
committed by kevinz000
parent 99e4db7bf4
commit 1265e804c5
+11
View File
@@ -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)