simplify retrieval of setting property

develop
Myk Taylor 2023-07-09 15:50:56 -07:00
parent 206c05feaf
commit 6fc86d715b
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 2 additions and 6 deletions

@ -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