Fixes redirect component transfers (#39290)

This commit is contained in:
Emmett Gaines
2018-07-24 21:03:53 +02:00
committed by AnturK
parent 5afaad1a78
commit 418ea4fa2a
20 changed files with 33 additions and 24 deletions
+3 -2
View File
@@ -10,7 +10,7 @@
var/list/arguments = args.Copy(2)
if(Initialize(arglist(arguments)) == COMPONENT_INCOMPATIBLE)
qdel(src, TRUE, TRUE)
CRASH("Incompatible [type] assigned to a [P.type]!")
CRASH("Incompatible [type] assigned to a [P.type]! args: [json_encode(arguments)]")
_JoinParent(P)
@@ -281,10 +281,11 @@
var/datum/old_parent = parent
PreTransfer()
_RemoveFromParent()
parent = null
SEND_SIGNAL(old_parent, COMSIG_COMPONENT_REMOVING, src)
/datum/proc/TakeComponent(datum/component/target)
if(!target)
if(!target || target.parent == src)
return
if(target.parent)
target.RemoveComponent()