Skip to content

Commit 4ab46c0

Browse files
committed
🐞 fix: #170
1 parent 376dd8f commit 4ab46c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Soldier76.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@ function pubg.autoSleep (isTest)
655655
Sleep(random)
656656
end
657657

658+
--[[ 四舍五入 #170 ]]
659+
function math.round (num, digit)
660+
local decimalPlaces = 10 ^ (digit or 0)
661+
return math.floor((num * decimalPlaces * 10 + 5) / 10) / decimalPlaces
662+
end
663+
658664
--[[ get real y position ]]
659665
function pubg.getRealY (options, y)
660666
local realY = y
@@ -669,7 +675,7 @@ function pubg.getRealY (options, y)
669675
realY = realY * options.ctrlmodeRatio
670676
end
671677

672-
return realY
678+
return math.round(realY)
673679
end
674680

675681
--[[ change pubg isStart status ]]

0 commit comments

Comments
 (0)