From 61720312cbec9e456145976e74cf2be6667374ec Mon Sep 17 00:00:00 2001 From: flamendless Date: Tue, 14 Feb 2023 18:18:42 -0300 Subject: [PATCH] Added optional table for output for entity:getComponents --- concord/entity.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/concord/entity.lua b/concord/entity.lua index 120146f..803006c 100644 --- a/concord/entity.lua +++ b/concord/entity.lua @@ -188,8 +188,9 @@ end -- Warning: Do not modify this table. -- Use Entity:give/ensure/remove instead -- @treturn table Table of all Components the Entity has -function Entity:getComponents() - local components = Utils.shallowCopy(self) +function Entity:getComponents(output) + output = output or {} + local components = Utils.shallowCopy(self, output) components.__world = nil components.__isEntity = nil