1
0
zrcadlo https://github.com/luanti-org/minetest_game.git synchronizováno 2026-01-08 02:15:20 +01:00

Beds: Quicker saves with tidy output

Tweaked the beds.save_spawns() function to compile list then output
to file with shortened co-ordinates containing 1 decimal place
Tento commit je obsažen v:
tenplus1
2016-03-28 20:14:35 +01:00
odevzdal paramat
rodič 5cd4b5a231
revize dc7cbdd5ab

Zobrazit soubor

@@ -41,10 +41,12 @@ function beds.save_spawns()
if not beds.spawn then
return
end
local data = {}
local output = io.open(org_file, "w")
for i, v in pairs(beds.spawn) do
output:write(v.x .. " " .. v.y .. " " .. v.z .. " " .. i .. "\n")
for k, v in pairs(beds.spawn) do
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k))
end
output:write(table.concat(data))
io.close(output)
end