diff --git a/parts/player/init.lua b/parts/player/init.lua index 8150d165..1e2cee4a 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -12,7 +12,7 @@ local PLY={draw=ply_draw} local modeDataMeta do local rawset=rawset modeDataMeta={ - __index=function(self,k) rawset(self,k,0)return 0 end, + __index=function(self,k) rawset(self,k,0) return 0 end, __newindex=function(self,k,v) rawset(self,k,v) end, } end diff --git a/parts/scenes/login_pw.lua b/parts/scenes/login_pw.lua index b8685c89..b1253474 100644 --- a/parts/scenes/login_pw.lua +++ b/parts/scenes/login_pw.lua @@ -6,9 +6,9 @@ local showEmail=true local function _login() local email,password=emailBox:getText(),passwordBox:getText() if not STRING.simpEmailCheck(email) then - MES.new('error',text.wrongEmail)return + MES.new('error',text.wrongEmail) return elseif #password==0 then - MES.new('error',text.noPassword)return + MES.new('error',text.noPassword) return end NET.pwLogin(email,password) end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 9c559115..64971dd5 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -89,8 +89,8 @@ end scene.mouseDown=NULL function scene.mouseMove(x,y) NETPLY.mouseMove(x,y) end function scene.touchDown(x,y) - if not playing then NETPLY.mouseMove(x,y)return end - if noTouch then return end + if not playing then NETPLY.mouseMove(x,y) return end + if NET.spectate or noTouch then return end local t=VK.on(x,y) if t then @@ -99,7 +99,7 @@ function scene.touchDown(x,y) end end function scene.touchUp(x,y) - if not playing or noTouch then return end + if not playing or NET.spectate or noTouch then return end local n=VK.on(x,y) if n then PLAYERS[1]:releaseKey(n) @@ -149,7 +149,7 @@ function scene.keyDown(key,isRep) WIDGET.focus(inputBox) inputBox:keypress(key) elseif playing then - if noKey or isRep then return end + if NET.spectate or noKey or isRep then return end local k=KEY_MAP.keyboard[key] if k and k>0 then PLAYERS[1]:pressKey(k) @@ -168,7 +168,7 @@ function scene.keyDown(key,isRep) end end function scene.keyUp(key) - if not playing or noKey then return end + if not playing or NET.spectate or noKey then return end local k=KEY_MAP.keyboard[key] if k and k>0 then PLAYERS[1]:releaseKey(k) @@ -253,8 +253,7 @@ function scene.update(dt) for i=1,#NETPLY.list do NETPLY.list[i].readyMode='Playing' end - noKey=PLAYERS[1].uid~=USER.uid - noTouch=noKey + NET.spectate=PLAYERS[1].uid~=USER.uid end end end diff --git a/parts/scenes/savedata.lua b/parts/scenes/savedata.lua index c6ecd863..61d4805e 100644 --- a/parts/scenes/savedata.lua +++ b/parts/scenes/savedata.lua @@ -10,7 +10,7 @@ local function _parseCB() -- Decode s=STRING.unpackText(s) - if not s then MES.new('error',text.dataCorrupted)return end + if not s then MES.new('error',text.dataCorrupted) return end s=loadstring(s) if s then