From 5a6539b6db235aa3256bcbee8df11f54cdaaf946 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Thu, 7 Apr 2022 16:11:26 +0200 Subject: [PATCH] fix gui issue --- modules/difficulty_vote_by_amount.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/difficulty_vote_by_amount.lua b/modules/difficulty_vote_by_amount.lua index 0b6714b1..c16684f8 100644 --- a/modules/difficulty_vote_by_amount.lua +++ b/modules/difficulty_vote_by_amount.lua @@ -333,7 +333,7 @@ Gui.on_click( end local player = event.player - if not player or not player.valid or not player.character then + if not player or not player.valid then return end @@ -373,13 +373,14 @@ Gui.on_click( return end local player = event.player - if not player or not player.valid or not player.character then + if not player or not player.valid then return end if game.tick > this.difficulty_poll_closing_timeout then clear_main_frame(player) return end + local screen = player.gui.center if screen[main_frame_name] and screen[main_frame_name].valid then clear_main_frame(player) @@ -397,7 +398,7 @@ Gui.on_click( return end local player = event.player - if not player or not player.valid or not player.character then + if not player or not player.valid then return end clear_main_frame(player)