Try to fix NULLs in E2Lib.PlayerChips#3571
Try to fix NULLs in E2Lib.PlayerChips#3571Astralcircle wants to merge 2 commits intowiremod:masterfrom
Conversation
|
Might be worth replacing E2Lib.PlayerChips __index with a 'getOrCreate' function. Then regular indexing can return nil and you don't need to use rawget. The problem is because of a null chip, not owner. https://github.com/wiremod/wire/blob/master/lua/entities/gmod_wire_expression2/init.lua#L310 |
|
I forget if chip owner can change or not, but that might be a possible cause if so. |
|
Really don't know how it appears. When it appears, it spams thousands of errors every tick and seems to only disappear when the owner leaves |
|
You could check if 'tab' is nil and delete the chip from the table if so. I'd add back the 'chips' table and make it indexed by chip, so you can use pairs to iterate and delete them while iterating. |
|
Ideally, the OnRemove would be functioning correctly though. |
|
Maybe something happens to the |
I'm not sure if this will fix the error, but it's worth a try