Closed lolbinarycat closed 10 months ago
How can I reproduce the issue to then test this PR's fix?
2024-01-06 12:43:08: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '??' in callback environment_Step(): MT/builtin/common/item_s.lua:229: bad argument #1 to '__index' (string expected, got nil)
2024-01-06 12:43:08: ERROR[Main]: stack traceback:
2024-01-06 12:43:08: ERROR[Main]: [C]: in function '__index'
2024-01-06 12:43:08: ERROR[Main]: MT/builtin/common/item_s.lua:229: in function <MT/builtin/common/item_s.lua:228>
2024-01-06 12:43:08: ERROR[Main]: [C]: in function 'swap_node'
2024-01-06 12:43:08: ERROR[Main]: MT/mods/mesecons/mesecons_delayer/init.lua:20: in function 'action_off'
2024-01-06 12:43:08: ERROR[Main]: MT/mods/mesecons/mesecons/internal.lua:207: in function <MT/mods/mesecons/mesecons/internal.lua:200>
2024-01-06 12:43:08: ERROR[Main]: MT/mods/mesecons/mesecons/actionqueue.lua:137: in function 'execute'
2024-01-06 12:43:08: ERROR[Main]: MT/mods/mesecons/mesecons/actionqueue.lua:111: in function <MT/mods/mesecons/mesecons/actionqueue.lua:73>
2024-01-06 12:43:08: ERROR[Main]: MT/builtin/common/register.lua:26: in function <MT/builtin/common/register.lua:12>
when placing an inverter into the indicated location:
@SmallJoker thanks, should be fixed now!
@lolbinarycat Thank you. I can no longer reproduce that error. However, I'd still like to know which circuit bug this PR aims to fix. Where can I see the change in behaviour?
@SmallJoker i didn't find a 100% reliable way to replicate it, but what i did was make a 1 tick piston clock (a sticky piston with a switch on its face, then use wire to connect the switch to the piston), then take a line from the clock to the back of a delayer.
if you destroy the wire directly behind the delayer with the correct timing, the delayer will get stuck in the "on" position despite there being no wire leading into it. also when i was doing that i was also intentionally lagging the game, which may or may not be required.
after this change, i was unable to replicate the bug with this method.
The singleplayer server tick is a bit too fast for this type of oscillator. OpenAL is not too happy about it. However, with this setup I did reproduce the bug and the PR does indeed fix it.
Fixes #656
i believe the cause of this bug is a chain of events as such:
delayer swaps node into on state
this may be caused by an underlying bug somewhere in the action queue, but simply changing the unpowered state so it also responds to power off events seems to do the trick just fine.