Added optional table for output for entity:getComponents

This commit is contained in:
flamendless 2023-02-14 18:18:42 -03:00 committed by Pablo Mayobre
parent 7b1df11cfb
commit e8ccf0f295
No known key found for this signature in database
GPG key ID: 13A2F589D013E0E7

View file

@ -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