Page 1 of 1

[Rseding91] LuaGuiElement (switch): allow_none_state is ignored and crash

Posted: Mon Aug 12, 2019 7:28 pm
by raiguard
Hello, I have two bugs for you. Here is a console command that will reproduce the bugs:

Code: Select all

/c game.player.gui.screen.add{type='frame', name='test_frame', caption='Test frame'}.add{type='switch', name='test_switch', allow_none_state=true, switch_state='none', left_label_caption='On', right_label_caption='Off'}
1: allow_none_state is ignored
If you run the above command, the game will return an error, saying that allow_none_state must be true if switch_state is set to none. However, you can clearly see in the command that allow_none_state is true, and the game is incorrectly throwing the error.

2: Crash
If you take the above command and change switch_state to left or right, the game will crash entirely. I have attached my log file below.

Re: LuaGuiElement (switch): allow_none_state is ignored and crash

Posted: Mon Aug 12, 2019 7:32 pm
by Bilka
Issue 1 is fixed for the next version.

Re: LuaGuiElement (switch): allow_none_state is ignored and crash

Posted: Mon Aug 12, 2019 11:56 pm
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.17.