Prevent integer overflow for crazy arrow
James Whitehead II [09-02-12 - 08:17]
Prevent integer overflow for crazy arrow
diff --git a/TomTom_CrazyArrow.lua b/TomTom_CrazyArrow.lua
index 0bfe4c6..f863127 100755
--- a/TomTom_CrazyArrow.lua
+++ b/TomTom_CrazyArrow.lua
@@ -219,7 +219,7 @@ local function OnUpdate(self, elapsed)
if speed > 0 then
local eta = math.abs(dist / speed)
- tta:SetFormattedText("%01d:%02d", eta / 60, eta % 60)
+ tta:SetFormattedText("%s:%02d", math.floor(eta / 60), math.floor(eta % 60))
else
tta:SetText("***")
end