1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-20 03:35:18 +02:00

Revert all commits up to (including) a704c04f

This commit is contained in:
kwolekr
2015-03-07 16:16:25 -05:00
parent ffdf8dedb7
commit 32352e90da
173 changed files with 8751 additions and 11138 deletions

View File

@@ -115,20 +115,11 @@ function core.serialize(x)
function dump_val(x)
local tp = type(x)
if x == nil then return "nil"
elseif tp == "number" then return string.format("%d", x)
elseif tp == "string" then return string.format("%q", x)
elseif tp == "boolean" then return x and "true" or "false"
elseif tp == "function" then
return string.format("loadstring(%q)", string.dump(x))
elseif tp == "number" then
-- Serialize integers with string.format to prevent
-- scientific notation, which doesn't preserve
-- precision and breaks things like node position
-- hashes. Serialize floats normally.
if math.floor(x) == x then
return string.format("%d", x)
else
return tostring(x)
end
elseif tp == "table" then
local vals = {}
local idx_dumped = {}