makes LoadComponent() a macro like AddComponent() is so it supports named arguments (#59185)

This commit is contained in:
Kylerace
2021-05-20 02:53:12 -07:00
committed by GitHub
parent 5b912dbe5f
commit b76a29675c
4 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -471,10 +471,10 @@
* * component_type The typepath of the component to create or return
* * ... additional arguments to be passed when creating the component if it does not exist
*/
/datum/proc/LoadComponent(component_type, ...)
. = GetComponent(component_type)
/datum/proc/_LoadComponent(list/arguments)
. = GetComponent(arguments[1])
if(!.)
return _AddComponent(args)
return _AddComponent(arguments)
/**
* Removes the component from parent, ends up with a null parent