]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/misc.lua
Fix parseColor, change remaining colorkeys to new format, fix Contributor list
[minetest.git] / builtin / misc.lua
index 8308b3d6b4d3e4250df0203710990c3085eb304f..4be03c38a302f59c9ef43e793264f8225bf6a369 100644 (file)
@@ -43,7 +43,7 @@ end
 function minetest.get_connected_players()
        -- This could be optimized a bit, but leave that for later
        local list = {}
-       for _, obj in pairs(minetest.env:get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do
+       for _, obj in pairs(minetest.get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do
                if obj:is_player() then
                        table.insert(list, obj)
                end
@@ -106,3 +106,13 @@ function minetest.formspec_escape(str)
        return str
 end
 
+function math.hypot(x, y)
+       local t
+       x = math.abs(x)
+       y = math.abs(y)
+       t = math.min(x, y)
+       x = math.max(x, y)
+       t = t / x
+       return x * math.sqrt(1 + t * t)
+end
+