修复创房间的人“当前场景”状态有问题导致别人退房的时候操作不能正确执行

This commit is contained in:
MrZ_26
2022-10-27 00:24:27 +08:00
parent 081b769ac6
commit 55218e4563

View File

@@ -439,9 +439,9 @@ end
--Remove player when leave --Remove player when leave
local function _playerLeaveRoom(uid) 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]=='net_game' then if SCN.stack[#SCN.stack]=='net_game' then
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 uid==USER.uid then if uid==USER.uid then
SCN.backTo('net_menu') SCN.backTo('net_menu')
else else
@@ -596,8 +596,8 @@ function NET.wsCallBack.room_chat(body)
end end
function NET.wsCallBack.room_create(body) function NET.wsCallBack.room_create(body)
MES.new('check',text.createRoomSuccessed) MES.new('check',text.createRoomSuccessed)
NET.wsCallBack.room_enter(body)
SCN.pop() SCN.pop()
NET.wsCallBack.room_enter(body)
WAIT.interrupt() WAIT.interrupt()
end end
function NET.wsCallBack.room_getData(body) function NET.wsCallBack.room_getData(body)