diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 36a81e90e2..7df96c3da2 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -537,3 +537,18 @@ if(!istype(the_matrix) || the_matrix.len != 20) return "#ffffffff" return rgb(the_matrix[1]*255, the_matrix[6]*255, the_matrix[11]*255, the_matrix[16]*255) + +/proc/type2parent(child) + var/string_type = "[child]" + var/last_slash = findlasttext(string_type, "/") + if(last_slash == 1) + switch(child) + if(/datum) + return null + if(/obj || /mob) + return /atom/movable + if(/area || /turf) + return /atom + else + return /datum + return text2path(copytext(string_type, 1, last_slash)) \ No newline at end of file diff --git a/code/datums/components/component.dm.rej b/code/datums/components/component.dm.rej new file mode 100644 index 0000000000..7d216a39c5 --- /dev/null +++ b/code/datums/components/component.dm.rej @@ -0,0 +1,18 @@ +diff a/code/datums/components/component.dm b/code/datums/components/component.dm (rejected hunks) +@@ -22,8 +22,7 @@ + //lazy init the parent's dc list + var/list/dc = P.datum_components + if(!dc) +- dc = list() +- P.datum_components = dc ++ P.datum_components = dc = list() + + //set up the typecache + var/our_type = type +@@ -179,4 +178,4 @@ + helicopter.SendSignal(COMSIG_COMPONENT_REMOVING, C) + C.OnTransfer(src) + C.parent = src +- SendSignal(COMSIG_COMPONENT_ADDED, C) +\ No newline at end of file ++ SendSignal(COMSIG_COMPONENT_ADDED, C)