wiremod/wire

Wirelinks create nil errors on client

Closed this issue · 0 comments

Description
If an entity has its wirelink generated and its entity / Create Entity output generated, trying to access its outputs again with the wire tool will create errors on the client and prevent them from selecting any.

To Reproduce

  1. Spawn an E2 chip with W = entity():wirelink()
  2. Spawn an E2 chip with @inputs E:entity
  3. Wire E on the second chip to Create Entity on the first chip
  4. Select E, or really any input from any entity, and look at the first chip again, which will now create an error

The same error happens with equivalent Starfall code as well, so it's not an E2-only problem.

Expected behavior
No errors, and for the wire output list to not break.

Screenshots

[wire] addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:268: attempt to index a nil value
  1. CachePorts - addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:268
   6. GetPorts - addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:291
    7. LoadMemorizedIndex - addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:817
     8. Think - addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:839
      9. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:167
Garry.s.Mod.x64.2023-11-22.10-34-50.mp4