From c99cc13526a8b35f120d70e57e44d2b8dd46d400 Mon Sep 17 00:00:00 2001 From: Oscar Manglaras <57207260+CogentRedTester@users.noreply.github.com> Date: Tue, 28 Jan 2020 00:37:02 +1030 Subject: options.lua: avoid unnecessary on_update calls The script was set up to only call on_update when the changelist was non-empty. However, since the size operator does not operate on dicts, it always returned 0 (which is truthy), thus on_update would always be called when the script-opts property changed. --- player/lua/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/lua/options.lua b/player/lua/options.lua index 31580f8320..c3039196be 100644 --- a/player/lua/options.lua +++ b/player/lua/options.lua @@ -152,7 +152,7 @@ local function read_options(options, identifier, on_update) end end last_opts = new_opts - if #changelist then + if next(changelist) ~= nil then on_update(changelist) end end) -- cgit v1.2.3