mt-mods / pipeworks

Pipeworks is a mod for Minetest allowing the crafting and usage of pipes and tubes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when mesecons is not installed, but detecting tube sends signal

Bastrabun opened this issue · comments

Repro: We send a mesecon signal via detecting tube (pipeworks:detector_tube_on_3) to trigger a nodebreaker.

have pipeworks and basic_materials, but NOT mesecons

  1. Connect vacuum tube to detecting tube to nodebreaker/deployer/...
  2. Throw an item in
    -> As soon as the item gets "detected", the server crashes with follow error:
AsyncErr: Lua: Runtime error from mod 'pipeworks' in callback environment_Step(): ...ev/minetest-play1/bin/../mods/pipeworks/signal_tubes.lua:62: attempt to index global 'mesecon' (a nil value)
stack traceback:
	...ev/minetest-play1/bin/../mods/pipeworks/signal_tubes.lua:62: in function 'can_go'
	.../minetest-play1/bin/../mods/pipeworks/item_transport.lua:88: in function 'go_next_compat'
	.../minetest-play1/bin/../mods/pipeworks/item_transport.lua:175: in function 'go_next'
	.../minetest-play1/bin/../mods/pipeworks/item_transport.lua:353: in function 'on_step'
	...0-dev/minetest-play1/bin/../mods/pipeworks/luaentity.lua:367: in function 'move_entities_globalstep_part2'
	...0-dev/minetest-play1/bin/../mods/pipeworks/luaentity.lua:380: in function <...0-dev/minetest-play1/bin/../mods/pipeworks/luaentity.lua:375>
	....6.0-dev/minetest-play1/bin/../builtin/game/register.lua:425: in function <....6.0-dev/minetest-play1/bin/../builtin/game/register.lua:409>

I admit it's rare that pipeworks is on a server, but mesecons isn't.
This may affect other piepeworks stuff that relies on the existence of mesecons.

I faintly remember something similar happening when not having the full mesecons modpack active.

How would one trigger the nodebreaker and deployer without mesecons anyway? (serious question, i've never used pipeworks without mesecons)

commented

5aa0501

@Bastrabun what commit are you running?

This should already be fixed in above commit (before that it was server owners responsibility to disable detector tubes, now it wont register detector tubes anymore without mesecons installed).

If however this would become a request to allow detector tubes without mesecons:

Reworking it could be to just update tube visuals when detecting items but not trying to send any mesecons signals, that allows keeping detector tubes (no cleanup / LBM to regular tube required) and would still provide simple visual feedback for detector tube.

Detector tube would still be detector tube without mesecons, just not sending mesecons signals.

The crash happened on the content DB release version of pipeworks. On current master I cannot reproduce due to no detecting tube available.

closing this, as the issue has been addressed. if some wants it, please make an issue for detector tubes working without mesecons