feat: add some more slop in to make sure all 4 corners work headed into them

This commit is contained in:
wsor4035 2023-08-13 19:54:17 -04:00
parent 19c0468ad7
commit 8abac3bacf

View File

@ -18,8 +18,8 @@ function rad_to_deg(x)
end end
local function is_centered(vec) --is centered ish local function is_centered(vec) --is centered ish
local fx, fz = math.floor(vec.x), math.floor(vec.z) local fx, fz = math.floor(vec.x+0.01), math.floor(vec.z+0.01)
if vec.x >= fx-0.1 and vec.x <= fx+0.1 and vec.z >= fz-0.1 and vec.z <= fz+0.1 then if vec.x >= fx-0.15 and vec.x <= fx+0.15 and vec.z >= fz-0.15 and vec.z <= fz+0.15 then
return true return true
else else
return false return false