Issue 104: Don't crash when clicking on combinator when the GUI is open

This commit is contained in:
Patrick Wrobel
2023-06-23 00:53:01 -04:00
parent 67a611c713
commit bfb417d0f5

View File

@@ -201,6 +201,9 @@ function gui_opened(comb, player)
combinator_update(global, comb, true)
local rootgui = player.gui.screen
if rootgui[COMBINATOR_NAME] then
rootgui[COMBINATOR_NAME].destroy()
end
local selected_index, signal, switch_state, bits = get_comb_gui_settings(comb)
local _, main_window = flib_gui.add(rootgui, {