From 6fc86d715b9a4a8390d3fd97288bf7cb78182dc6 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 9 Jul 2023 15:50:56 -0700 Subject: [PATCH] simplify retrieval of setting property --- library/Core.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index 13717ad30..0a1c19351 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -2360,12 +2360,8 @@ static bool getSuppressDuplicateKeyboardEvents() { auto L = Lua::Core::State; color_ostream_proxy out(Core::getInstance().getConsole()); Lua::StackUnwinder top(L); - bool suppress = false; - Lua::CallLuaModuleFunction(out, L, "dfhack", "getSuppressDuplicateKeyboardEvents", 0, 1, - Lua::DEFAULT_LUA_LAMBDA, [&](lua_State* L) { - suppress = lua_toboolean(L, -1); - }, false); - return suppress; + return DFHack::Lua::PushModulePublic(out, L, "dfhack", "SUPPRESS_DUPLICATE_KEYBOARD_EVENTS") && + lua_toboolean(L, -1); } // returns true if the event is handled