summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/chunk.lua4
-rw-r--r--server/server.lua4
-rw-r--r--server/worldgen.lua2
3 files changed, 7 insertions, 3 deletions
diff --git a/server/chunk.lua b/server/chunk.lua
index 1e2e135..8e71327 100644
--- a/server/chunk.lua
+++ b/server/chunk.lua
@@ -15,6 +15,10 @@ function ChunkS.load_from_disk(cls,cp)
if not f then return nil end
local j = json.decode(f:read("a"))
self = cls:from_packet_data(j)
+ for i,t in ipairs(self.tiles) do
+ if t == false then self.tiles[i] = 0
+ elseif t == true then self.tiles[i] = 9 end
+ end
f:close()
return self
end
diff --git a/server/server.lua b/server/server.lua
index 88f4efe..85112c9 100644
--- a/server/server.lua
+++ b/server/server.lua
@@ -174,11 +174,11 @@ end
local function tick(ntick)
if ntick % 30 == 0 then
- print("saving things")
+ -- print("saving things")
for cp,ch in map:iter_chunks() do
map:save_chunk(cp)
if not player_near_chunk(cp) then
- print("unloading chunk",cp)
+ -- print("unloading chunk",cp)
map:remove_chunk(cp)
end
end
diff --git a/server/worldgen.lua b/server/worldgen.lua
index e4e1a4c..3f318d1 100644
--- a/server/worldgen.lua
+++ b/server/worldgen.lua
@@ -28,7 +28,7 @@ local function gen_chunk(chpos)
local ix = chunk.index(q,r)
local nv = surface_ng:at(p.x,p.y)
if nv <= 0 then
- tiles[ix] = false
+ tiles[ix] = 0
else
local nv2 = color_ng:at(p.x,p.y)
nv2 = math.max(-0.9999999,math.min(0.9999999,nv2*2.5))