fix lua stack manipulations

This commit is contained in:
MihailRis
2025-01-07 20:57:38 +03:00
parent 13de581b4b
commit e7555448cf
3 changed files with 39 additions and 24 deletions
@@ -40,6 +40,7 @@ static int l_add_callback(lua::State* L) {
throw std::runtime_error("on_hud_open is not called yet");
}
auto key = input_util::keycode_from(bindname.substr(pos + 1));
lua::pushvalue(L, 2);
auto callback = lua::create_simple_handler(L);
hud->keepAlive(Events::keyCallbacks[key].add(callback));
return 0;