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()