From dbbec9d2bda4db8598ce64b1a15bc271ecefc55e Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sun, 18 Dec 2022 22:22:53 +0800 Subject: [PATCH] =?UTF-8?q?freshPlayerPosition=E6=96=B9=E6=B3=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=89=A7=E8=A1=8C=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=B8=B8=E6=88=8F=E4=B8=AD=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gameFuncs.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua index 9578a35f..65f94511 100644 --- a/parts/gameFuncs.lua +++ b/parts/gameFuncs.lua @@ -652,9 +652,10 @@ do-- function freshPlayerPosition(sudden) return L end)(), } - function freshPlayerPosition(sudden)-- Set initial position for every player + function freshPlayerPosition(mode)-- Set initial position for every player, mode: 'normal'|'quick'|'update' + assert(mode=='normal' or mode=='quick' or mode=='update',"Wrong freshPlyPos mode") local L=PLY_ALIVE - if not sudden then + if mode~='update' then for i=1,#L do L[i]:setPosition(640,#L<=5 and 360 or -62,0) end @@ -668,7 +669,7 @@ do-- function freshPlayerPosition(sudden) elseif #L<=99 then posList=posLists[5] else error("TOO MANY PLAYERS!") end - local method=sudden and 'setPosition' or 'movePosition' + local method=mode=='normal' and 'setPosition' or 'movePosition' for i=1,#L do L[i][method](L[i],unpack(posList[i])) end end end @@ -772,7 +773,7 @@ do-- function resetGameData(args) else PLY.newPlayer(1) end - freshPlayerPosition(args:find'q') + freshPlayerPosition((args:find'q') and 'quick' or 'normal') VK.restore() local bg=GAME.modeEnv.bg