summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-10-10 22:42:58 +0200
committerAki <nthirtyone@gmail.com>2016-10-10 22:42:58 +0200
commit941d0214a4a1b499190f4f3c6133b5e512d897fe (patch)
treedea46e5c40854aeb7b037e2cbbd1aaca8ebeb985
parent7e567d1fc37d8e65e4e8fe5c7ece2cea8a6567b1 (diff)
downloadroflnauts-941d0214a4a1b499190f4f3c6133b5e512d897fe.zip
roflnauts-941d0214a4a1b499190f4f3c6133b5e512d897fe.tar.gz
roflnauts-941d0214a4a1b499190f4f3c6133b5e512d897fe.tar.bz2
Add joystick controllers only if js present
-rw-r--r--settings.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/settings.lua b/settings.lua
index 920abdf..93432a0 100644
--- a/settings.lua
+++ b/settings.lua
@@ -12,10 +12,14 @@ function Settings.load()
local getSettings = love.filesystem.load("settings")
for _,set in pairs(getSettings()) do
local isJoystick = set[7]
+ local joystick
if isJoystick then
+ joystick = love.joystick.getJoysticks()[1]
-- Add first free joystick from joysticks list
end
- Controller.registerSet(set[1], set[2], set[3], set[4], set[5], set[6], joystick)
+ if not isJoystick or joystick then
+ Controller.registerSet(set[1], set[2], set[3], set[4], set[5], set[6], joystick)
+ end
end
end
end