修正一处手柄事件可能爆炸

This commit is contained in:
MrZ626
2021-12-06 21:17:30 +08:00
parent bb9a35c161
commit b5a9c8e1bb

View File

@@ -397,7 +397,7 @@ function love.joystickremoved(JS)
end
end
function love.gamepadaxis(JS,axis,val)
if JS==jsState[1]._jsObj then
if jsState[1]and JS==jsState[1]._jsObj then
local js=jsState[1]
if axis=='leftx'or axis=='lefty'or axis=='rightx'or axis=='righty'then
local newVal=--range: [0,1]