From 9265026e1e421f7624b3a004db51064960c2bb11 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 16 Mar 2021 12:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=A9=E7=90=86hold?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=8D=A1=E6=AD=BB=E5=92=8C=E8=B8=A2?= =?UTF-8?q?=E5=A2=99=E6=B5=8B=E8=AF=95=E4=BD=8D=E7=BD=AE=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/player.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/parts/player/player.lua b/parts/player/player.lua index 81c015e3..51b2bdc9 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -636,20 +636,22 @@ function Player.hold(P,ifpre) x=x+(#C.bk[1]-#H.bk[1])*.5 y=y+(#C.bk-#H.bk)*.5 - local X=x - while X<=x+1 do - X=int(X) - for Y=int(y),ceil(y)do + for Y=int(y),ceil(y+.5)do + local X=x + while true do + X=int(X) if not P:ifoverlap(H.bk,X,Y)then x,y=X,Y success=true goto BREAK end - end - if X==x then - X=X-1 - elseif X