fix: input.add_callback and blocks placing when shift pressed

This commit is contained in:
MihailRis
2024-06-05 18:32:43 +03:00
parent 9dadae6e34
commit 9211e835db
2 changed files with 11 additions and 6 deletions
+3 -2
View File
@@ -31,16 +31,17 @@ static int l_mousecode(lua_State* L) {
return 1;
}
static int l_add_callback(lua_State* L) {
static int l_add_callback(lua_State*) {
auto bindname = state->requireString(1);
const auto& bind = Events::bindings.find(bindname);
if (bind == Events::bindings.end()) {
throw std::runtime_error("unknown binding "+util::quote(bindname));
}
state->pushvalue(2);
runnable actual_callback = state->createRunnable();
runnable callback = [=]() {
if (!scripting::engine->getGUI()->isFocusCaught()) {
state->createRunnable();
actual_callback();
}
};
if (hud) {