Merge pull request #50 from flamendless/experimental

Added optional table for output for entity:getComponents
This commit is contained in:
Pablo Ariel Mayobre 2021-09-04 09:44:32 -03:00 committed by GitHub
commit 5229358eb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,8 +188,9 @@ end
-- Warning: Do not modify this table. -- Warning: Do not modify this table.
-- Use Entity:give/ensure/remove instead -- Use Entity:give/ensure/remove instead
-- @treturn table Table of all Components the Entity has -- @treturn table Table of all Components the Entity has
function Entity:getComponents() function Entity:getComponents(output)
local components = Utils.shallowCopy(self) output = output or {}
local components = Utils.shallowCopy(self, output)
components.__world = nil components.__world = nil
components.__isEntity = nil components.__isEntity = nil