mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
makes LoadComponent() a macro like AddComponent() is so it supports named arguments (#59185)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user