From 1039479c47e4fb4d820cb7ea0874acb13da72044 Mon Sep 17 00:00:00 2001 From: lustlion Date: Sun, 13 Mar 2022 09:57:44 +0100 Subject: [PATCH] Keybinds can be occupied (when being checked down) --- code/keybind.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/keybind.lua b/code/keybind.lua index 3c4105f..d3248b3 100644 --- a/code/keybind.lua +++ b/code/keybind.lua @@ -17,6 +17,10 @@ Keybind.debug = {} Keybind.editor = {} Keybind.generic = {} +function Keybind:isAvailable(action) + return not action.occupied +end + function Keybind:checkDown(action) if DemoPlayback then for _, demo_action in pairs(DemoAction[CurrentDemoFrame]) do @@ -37,9 +41,11 @@ function Keybind:checkDown(action) if action.demo ~= nil then Demo:recordAction(action.demo) end + action.occupied = true return true end end + action.occupied = false return false end end