Skip to content

Commit

Permalink
🐞 fix: #170
Browse files Browse the repository at this point in the history
  • Loading branch information
kiccer committed Jul 11, 2022
1 parent 376dd8f commit 4ab46c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Soldier76.lua
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,12 @@ function pubg.autoSleep (isTest)
Sleep(random)
end

--[[ 四舍五入 #170 ]]
function math.round (num, digit)
local decimalPlaces = 10 ^ (digit or 0)
return math.floor((num * decimalPlaces * 10 + 5) / 10) / decimalPlaces
end

--[[ get real y position ]]
function pubg.getRealY (options, y)
local realY = y
Expand All @@ -669,7 +675,7 @@ function pubg.getRealY (options, y)
realY = realY * options.ctrlmodeRatio
end

return realY
return math.round(realY)
end

--[[ change pubg isStart status ]]
Expand Down

0 comments on commit 4ab46c0

Please sign in to comment.