1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

fix round

This commit is contained in:
Hellss
2022-01-13 22:26:57 +03:00
parent 47ad07d50a
commit 3a8fd4c194

View File

@@ -589,12 +589,12 @@ end
---------------------------------------------------------------------------------------
function ENT:SetPackedRatio(idx,value)
--local idx = type(idx) == "number" and 999-idx or idx
if self._NetData[2][idx] ~= nil and self._NetData[2][idx] == math.Round(value*1000) then return end
self:SetNW2Int(idx,math.Round(value*1000))
if self._NetData[2][idx] ~= nil and self._NetData[2][idx] == math.floor(value*1000+0.5) then return end
self:SetNW2Int(idx,math.floor(value*1000+0.5))
end
function ENT:GetPackedRatio(idx)
return self:GetNW2Int(idx)/1000
return self:GetNW2Int(idx)*0.001
end
--------------------------------------------------------------------------------