From c9a3075d0ae020ad86775e8c8ba2fd9ddc245907 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 14 May 2021 19:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=94=E7=BD=91=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E5=86=85=E6=BD=9C=E5=9C=A8=E7=9A=84=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E5=8F=AF=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/net_game.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index ebcc4b25..224763ab 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -46,7 +46,6 @@ function scene.touchDown(x,y) end function scene.touchUp(x,y) if not playing or noTouch then return end - local n=VK.on(x,y) if n then PLAYERS[1]:releaseKey(n) @@ -54,7 +53,7 @@ function scene.touchUp(x,y) end end function scene.touchMove(x,y) - if not playing then netPLY.mouseMove(x,y)end + if not playing then netPLY.mouseMove(x,y)return end if touchMoveLastFrame or noTouch then return end touchMoveLastFrame=true @@ -107,7 +106,7 @@ function scene.keyDown(key) WIDGET.sel=inputBox WIDGET.keyPressed(key) elseif playing then - if noKey then return end + if not playing or noKey then return end local k=keyMap.keyboard[key] if k and k>0 then PLAYERS[1]:pressKey(k) @@ -124,7 +123,7 @@ function scene.keyDown(key) end end function scene.keyUp(key) - if noKey then return end + if not playing or noKey then return end local k=keyMap.keyboard[key] if k and k>0 then PLAYERS[1]:releaseKey(k) @@ -135,6 +134,7 @@ function scene.gamepadDown(key) if key=="back"then scene.keyDown("escape") else + if not playing then return end local k=keyMap.joystick[key] if k and k>0 then PLAYERS[1]:pressKey(k) @@ -143,6 +143,7 @@ function scene.gamepadDown(key) end end function scene.gamepadUp(key) + if not playing then return end local k=keyMap.joystick[key] if k and k>0 then PLAYERS[1]:releaseKey(k)