Skip to content

Commit

Permalink
Fix clear_callback in set_hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Mar 5, 2024
1 parent ebba64b commit 4f446a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game_api/script/lua_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ int LuaBackend::register_hotkey(HotKeyCallback cb, HOTKEY_TYPE flags)

void LuaBackend::hotkey_callback(int cb)
{
if (!hotkey_callbacks.contains(cb))
if (!get_enabled() || !hotkey_callbacks.contains(cb))
return;
hotkey_callbacks[cb].queue++;
}
Expand Down
1 change: 1 addition & 0 deletions src/game_api/script/lua_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ end
switch (caller.type)
{
case CallbackType::Normal:
case CallbackType::HotKey:
backend->clear_callbacks.push_back(caller.id);
break;
case CallbackType::Entity:
Expand Down

0 comments on commit 4f446a8

Please sign in to comment.