Why a 'local' table keeps growing across calls
🌙 Lua•Updated 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.