bugfix: action checks without demo wouldnt be properly registered

This commit is contained in:
lustlion 2022-02-18 00:17:36 +01:00
parent a722c019f3
commit 405c80d039
1 changed files with 10 additions and 5 deletions

View File

@ -27,12 +27,17 @@ function Keybind:CheckDown(action)
return false return false
else else
for _, keyname in pairs(action.keys) do for _, keyname in pairs(action.keys) do
local fn = love.keyboard.isDown local check = false
if not type(keyname) == "string" then if type(keyname) == "string" then
local fn = love.mouse.isDown check = love.keyboard.isDown(keyname)
else
check = love.mouse.isDown(keyname)
end end
if fn(keyname) then
if check then
if action.demo ~= nil then
Demo:RecordAction(action.demo) Demo:RecordAction(action.demo)
end
return true return true
end end
end end