proc/get_parent_type(typepath) var/datum/dummy = typepath return initial(dummy.parent_type)
This currently throws a runtime error of
cannot change constant valueMy proposed change is to make it so it instead returns the actual value of parent_type on that type. Applying it to other constants might be useful too.
If this is not feasible due to limitations unknown to me I instead propose a global proc to get the parent type of a type that would serve the same purpose.
In this implementation, the table is fully generated upon first use.