Page 1 of 1

[Solved] Error in shortcuts mod

Posted: Wed Aug 12, 2020 9:41 pm
by ickputzdirwech
I try to maintain mods.factorio.com/mod/Shortcuts for 0.18. Part of it goes way beyond my skillset, but I like the challenge. This time however, I just can't figure it out.

The bug even seems to be an inheritance from the 0.17 version of the mod. The mod implements among other things shortcuts to disable nightvision, belt immunity equipment and personal laser defense. But when clicking on those shortcuts there is always the following error:

Code: Select all

Error while running event Shortcuts-ick::on_lua_shortcut (ID 34)
LuaEquipment API call when LuaEquipment was invalid.
stack traceback:
	[C]: in function 'take'
	__Shortcuts-ick__/control.lua:43: in function 'update_state'
	__Shortcuts-ick__/control.lua:372: in function <__Shortcuts-ick__/control.lua:362>
stack traceback:
	[C]: in ?
	[C]: in function 'take'
	__Shortcuts-ick__/control.lua:43: in function 'update_state'
	__Shortcuts-ick__/control.lua:372: in function <__Shortcuts-ick__/control.lua:362>
You can find my version of the mod here: mods.factorio.com/mod/Shortcuts-ick.

Any hint what might cause this bug would be appreciated.

Re: Error in shortcuts mod

Posted: Thu Aug 13, 2020 12:45 pm
by ickputzdirwech
Well it took me some hours of trial and error, learning quite a lot new stuff and it turns out it was a two line fix. I feel like it was quite an obvious mistake, but I don't thing I am qualified for such a judgement yet. :D