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
else
for _, keyname in pairs(action.keys) do
local fn = love.keyboard.isDown
if not type(keyname) == "string" then
local fn = love.mouse.isDown
local check = false
if type(keyname) == "string" then
check = love.keyboard.isDown(keyname)
else
check = love.mouse.isDown(keyname)
end
if fn(keyname) then
if check then
if action.demo ~= nil then
Demo:RecordAction(action.demo)
end
return true
end
end