[MIRROR] makes LoadComponent() a macro like AddComponent() is so it supports named arguments (#5802)

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

* Update miscellaneous.dm

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-05-21 00:27:18 +02:00
committed by GitHub
parent 224a549da4
commit 2e473b758e
4 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -473,10 +473,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