From b436645ab7f90fcf5f5922050f91ca8ee91bc251 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Wed, 26 Oct 2022 03:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=87=A0=E5=A4=84=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=BD=93=E5=89=8D=E5=9C=BA=E6=99=AF=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=B9=8B=E5=89=8D=E6=9B=B4=E6=96=B0=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=BF=98=E4=BA=86=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 8 ++++---- parts/net.lua | 4 ++-- parts/player/player.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.lua b/main.lua index bef38b83..479c1590 100644 --- a/main.lua +++ b/main.lua @@ -60,11 +60,11 @@ BGM.setMaxSources(5) VOC.setDiversion(.62) WIDGET.setOnChange(function() - if SCN.stack[#SCN.stack-1]~='custom_field' then + if SCN.stack[#SCN.stack]~='custom_field' then local colorList=THEME.getThemeColor() if not colorList then return end local rnd=math.random - for _,W in next,SCN.scenes[SCN.stack[#SCN.stack-1]].widgetList do + for _,W in next,SCN.scenes[SCN.stack[#SCN.stack]].widgetList do if W.color then W.color=colorList[rnd(#colorList)] end @@ -218,10 +218,10 @@ do-- Z.setOnFocus TASK.new(task_autoSoundOn) end else - if SCN.stack[#SCN.stack-1]=='game' and SETTING.autoPause then + if SCN.stack[#SCN.stack]=='game' and SETTING.autoPause then pauseGame() end - if SETTING.autoMute and SCN.stack[#SCN.stack-1]~='music' then + if SETTING.autoMute and SCN.stack[#SCN.stack]~='music' then TASK.removeTask_code(task_autoSoundOn) TASK.new(task_autoSoundOff) end diff --git a/parts/net.lua b/parts/net.lua index fa572be5..0698036d 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -441,7 +441,7 @@ end local function _playerLeaveRoom(uid) for i=1,#PLAYERS do if PLAYERS[i].uid==uid then table.remove(PLAYERS,i) break end end for i=1,#PLY_ALIVE do if PLY_ALIVE[i].uid==uid then table.remove(PLY_ALIVE,i) break end end - if SCN.stack[#SCN.stack-1]=='net_game' then + if SCN.stack[#SCN.stack]=='net_game' then if uid==USER.uid then SCN.backTo('net_menu') else @@ -585,7 +585,7 @@ function NET.wsCallBack.global_getOnlineCount(body) NET.onlineCount=tonumber(body.data) or "_" end function NET.wsCallBack.room_chat(body) - if SCN.stack[#SCN.stack-1]=='net_game' then + if SCN.stack[#SCN.stack]=='net_game' then TASK.unlock('receiveMessage') TASK.lock('receiveMessage',1) NET.textBox:push{ diff --git a/parts/player/player.lua b/parts/player/player.lua index 12eda8fd..07e4d40a 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -2192,7 +2192,7 @@ local function task_autoPause() while true do yield() time=time+1 - if SCN.stack[#SCN.stack-1]~='game' or PLAYERS[1].frameRun<180 then + if SCN.stack[#SCN.stack]~='game' or PLAYERS[1].frameRun<180 then return elseif time==120 then pauseGame()