From 14ceaa39b467a419494356218d401c156b664b6e Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 26 Aug 2017 21:11:03 -0500 Subject: [PATCH] Fixes component dupe checks not actually checking if there IS a dupe component (#2501) --- code/datums/components/component.dm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/datums/components/component.dm b/code/datums/components/component.dm index 92ac9a4767..6b902a6ac6 100644 --- a/code/datums/components/component.dm +++ b/code/datums/components/component.dm @@ -19,15 +19,16 @@ old = P.GetExactComponent(type) else old = P.GetComponent(dt) - switch(dm) - if(COMPONENT_DUPE_UNIQUE) - old.InheritComponent(src, TRUE) - parent = null //prevent COMPONENT_REMOVING signal - qdel(src) - return - if(COMPONENT_DUPE_HIGHLANDER) - InheritComponent(old, FALSE) - qdel(old) + if(old) + switch(dm) + if(COMPONENT_DUPE_UNIQUE) + old.InheritComponent(src, TRUE) + parent = null //prevent COMPONENT_REMOVING signal + qdel(src) + return + if(COMPONENT_DUPE_HIGHLANDER) + InheritComponent(old, FALSE) + qdel(old) //let the others know P.SendSignal(COMSIG_COMPONENT_ADDED, src)