anchor.diff:  		if(old)
   			switch(dm)
   				if(COMPONENT_DUPE_HIGHLANDER)
  -					P.RemoveComponent(old)
  -					old = null	//in case SendSignal() blocks
  +					InheritComponent(old, FALSE)
  +					qdel(old)
   				if(COMPONENT_DUPE_UNIQUE)
  +					old.InheritComponent(src, TRUE)
   					qdel(src)
   					return
  -	P.SendSignal(COMSIG_COMPONENT_ADDED, list(src), FALSE)
  -	LAZYADD(P.datum_components, src)
  +	P.SendSignal(COMSIG_COMPONENT_ADDED, src)
  +	
  +	//lazy init the parent's dc list
  +	var/list/dc = P.datum_components
  +	if(!dc)
  +		P.datum_components = dc = list()
  +	
  +	//set up the typecache
  +	var/our_type = type
  +	for(var/I in _GetInverseTypeListExceptRoot(our_type))
  +		var/test = dc[I]
  +		if(test)	//already another component of this type here
  +			var/list/components_of_type
  +			if(!islist(test))
  +				components_of_type = list(test)
  +				dc[I] = components_of_type
  +			else
  +				components_of_type = test
  +			if(I == our_type)	//exact match, take priority
  +				var/inserted = FALSE
  +				for(var/J in 1 to components_of_type.len)
  +					var/datum/component/C = components_of_type[J]
  +					if(C.type != our_type) //but not over other exact matches
  +						components_of_type.Insert(J, I)
  +						inserted = TRUE
  +						break
  +				if(!inserted)
  +					components_of_type += src
  +			else	//indirect match, back of the line with ya
  +				components_of_type += src
  +		else	//only component of this type, no list
  +			dc[I] = src
  +
   	parent = P
   
   /datum/component/Destroy()
  -	RemoveNoSignal()
  +	enabled = FALSE
  +	var/datum/P = parent
  +	if(P)
  +		_RemoveNoSignal()
  +		P.SendSignal(COMSIG_COMPONENT_REMOVING, src)
  +	LAZYCLEARLIST(signal_procs)
   	return ..()
   
  -/datum/component/proc/RemoveNoSignal()
  +/datum/component/proc/_RemoveNoSignal()
   	var/datum/P = parent
   	if(P)
  -		LAZYREMOVE(P.datum_components, src)
  +		var/list/dc = P.datum_components
  +		var/our_type = type
  +		for(var/I in _GetInverseTypeListExceptRoot(our_type))
  +			var/list/components_of_type = dc[I]
  +			if(islist(components_of_type))	//
  +				var/list/subtracted = components_of_type - src
  +				if(subtracted.len == 1)	//only 1 guy left
  +					dc[I] = subtracted[1]	//make him special
  +				else
  +					dc[I] = subtracted
  +			else	//just us
  +				dc -= I
  +		if(!dc.len)
  +			P.datum_components = null
   		parent = null
   
   /datum/component/proc/RegisterSignal(sig_type, proc_on_self, override = FALSE)
  +	if(QDELETED(src))
  +		return
   	var/list/procs = signal_procs
   	if(!procs)
   		procs = list()
  
positive.code: 	
  	procs[sig_type] = CALLBACK(src, proc_on_self)    
  
  /datum/var/list/datum_components //list of /datum/component
  
  // Send a signal to all other components in the container.
  /datum/proc/SendSignal(sigtype, list/sig_args, async = FALSE)
  	var/list/comps = datum_components
  	. = FALSE
  	for(var/I in comps)
  		var/datum/component/C = I
  		if(!C.enabled)
  			continue
  		var/list/sps = C.signal_procs
  		var/datum/callback/CB = LAZYACCESS(sps, sigtype)
  		if(!CB)
  			continue
  		if(!async)
  			. |= CB.Invoke(sig_args)
  		else
  			. |= CB.InvokeAsync(sig_args)
  
  /datum/proc/GetComponent(c_type)
  	for(var/I in datum_components)
  		if(istype(I, c_type))
  			return I
  
  /datum/proc/GetExactComponent(c_type)
  	for(var/I in datum_components)
  		var/datum/component/C = I
  		if(C.type == c_type)
  			return I
  
  /datum/proc/GetComponents(c_type)
  	. = list()
  	for(var/I in datum_components)
  		if(istype(I, c_type))
  			. += I
  
  /datum/proc/AddComponents(list/new_types)
  	for(var/new_type in new_types)
  		AddComponent(new_type)
  
  /datum/proc/AddComponent(new_type, ...)
  	var/nt = new_type
  
negative.code: 	var/datum/component/C = new nt(arglist(args))
  	return QDELING(C) ? GetComponent(new_type) : C
  
  /datum/proc/TakeComponent(datum/component/C)
  	if(!C)
  		return
  	var/datum/helicopter = C.parent
  	if(helicopter == src)
  		//wat
  		return
  	C._RemoveNoSignal()
  	helicopter.SendSignal(COMSIG_COMPONENT_REMOVING, C)
  	C.OnTransfer(src)
  	C.parent = src
  	SendSignal(COMSIG_COMPONENT_ADDED, C)
  