💬

Community answer

Collected from the ACE community Discord archive around 2023-02-18. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

Why a 'local' table keeps growing across calls

🌙 LuaUpdated 2 days ago•0 views
Tables are passed by reference - 'local filter = turrets' doesn't copy the table, so table.insert(filter, ...) mutates the shared outer table. Copy the table fi…

Why does my local variable/table keep accumulating entries even inside a new block

Tables are passed by reference - 'local filter = turrets' doesn't copy the table, so table.insert(filter, ...) mutates the shared outer table. Copy the table first (table.copy) before inserting.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.