回合制模式使用玩家sid处理回合顺序
本地玩家也有sid了(跟id相同)
This commit is contained in:
@@ -2,12 +2,17 @@ return{
|
|||||||
dropPiece=function(P)
|
dropPiece=function(P)
|
||||||
if #PLY_ALIVE>1 then
|
if #PLY_ALIVE>1 then
|
||||||
P.control=false
|
P.control=false
|
||||||
local ID=P.id
|
local id1=P.sid
|
||||||
repeat
|
local minMaxID,minID=1e99,1e99
|
||||||
ID=ID+1
|
for i=1,#PLY_ALIVE do
|
||||||
if not PLAYERS[ID]then ID=1 end
|
local id2=PLY_ALIVE[i].sid
|
||||||
until PLAYERS[ID].alive or ID==P.id
|
if id2>id1 then
|
||||||
PLAYERS[ID].control=true
|
minMaxID=math.min(minMaxID,id2)
|
||||||
|
else
|
||||||
|
minID=math.min(minID,id2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
PLY_ALIVE[minMaxID==1e99 and minID or minMaxID].control=true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,17 @@ return{
|
|||||||
dropPiece=function(P)
|
dropPiece=function(P)
|
||||||
if P.stat.piece%7==0 and #PLY_ALIVE>1 then
|
if P.stat.piece%7==0 and #PLY_ALIVE>1 then
|
||||||
P.control=false
|
P.control=false
|
||||||
local ID=P.id
|
local id1=P.sid
|
||||||
repeat
|
local minMaxID,minID=1e99,1e99
|
||||||
ID=ID+1
|
for i=1,#PLY_ALIVE do
|
||||||
if not PLAYERS[ID]then ID=1 end
|
local id2=PLY_ALIVE[i].sid
|
||||||
until PLAYERS[ID].alive or ID==P.id
|
if id2>id1 then
|
||||||
PLAYERS[ID].control=true
|
minMaxID=math.min(minMaxID,id2)
|
||||||
|
else
|
||||||
|
minID=math.min(minID,id2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
PLY_ALIVE[minMaxID==1e99 and minID or minMaxID].control=true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ local function _newEmptyPlayer(id,mini)
|
|||||||
--User-related
|
--User-related
|
||||||
P.username=""
|
P.username=""
|
||||||
P.uid=false
|
P.uid=false
|
||||||
P.sid=false
|
P.sid=id
|
||||||
|
|
||||||
--Block states
|
--Block states
|
||||||
--[[
|
--[[
|
||||||
|
|||||||
Reference in New Issue
Block a user