Switch Button by GalactusX31 updated for 1.0


This mod adds on/off switch button for sending a single circuit network signal. Mod settings allow to either toggle On/Off state by left-click and access inventory via hotkey, or to work like a regular constant combinator.

Content
3 years ago
1.0 - 1.1
8.44K
Circuit network

g [fixed] Crash on key press

3 years ago
(updated 3 years ago)

Hi

it seems that your method onKey in control.lua doesn't check if the entity is a switchbutton or something else. (it also doesn't check if the entity is valid) This generates a non-recoverable error when pressing the assigned key while selecting a different entity (or at least an entity without control behaviour).

If it matters, I have "Toggle on/off on click" set to false.


The mod Switch Button by GalactusX31 updated for 1.0 (0.1.19) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Switch_Button-1_0::switchbutton-keybind (ID 218)
Switch_Button-1_0/control.lua:63: attempt to index local 'control' (a nil value)
stack traceback:
Switch_Button-1_0/control.lua:63: in function <Switch_Button-1_0/control.lua:55>

mk-fg β˜†
3 years ago

It did check if entity is valid in player_can_reach_button, but indeed didn't check if it was switchbutton or anything else.
Which was apparently a bug since the old mod, and probably went unnoticed because most player-built stuff has some control behavior.

Should be fixed in 0.1.21+. Thanks for reporting.

New response