diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 000f8790084..b9e92ca4423 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -328,7 +328,7 @@ var/datum/component/old_component raw_args[1] = src - if(dupe_mode != COMPONENT_DUPE_ALLOWED && dupe_mode != COMPONENT_DUPE_SELECTIVE && dupe_mode != COMPONENT_DUPE_SOURCES) + if(dupe_mode != COMPONENT_DUPE_ALLOWED && dupe_mode != COMPONENT_DUPE_SELECTIVE) old_component = GetComponent(component_type) if(old_component) @@ -378,16 +378,13 @@ if(!new_component && make_new_component) new_component = new component_type(raw_args) - else if(dupe_mode == COMPONENT_DUPE_SOURCES) - new_component = new component_type(raw_args) - if(new_component.on_source_add(arglist(list(source) + raw_args.Copy(2))) == COMPONENT_INCOMPATIBLE) - stack_trace("incompatible source added to a [new_component.type]. Args: [json_encode(raw_args)]") - return null - else if(!new_component) new_component = new component_type(raw_args) // Dupes are allowed, act like normal if(!old_component && !QDELETED(new_component)) // Nothing related to duplicate components happened and the new component is healthy + if(source && new_component.on_source_add(arglist(list(source) + raw_args.Copy(2))) == COMPONENT_INCOMPATIBLE) + stack_trace("incompatible source added to a [new_component.type]. Args: [json_encode(raw_args)]") + return null SEND_SIGNAL(src, COMSIG_COMPONENT_ADDED, new_component) return new_component