From 7e0a520f8efd748a13c277b3c39514aee07c74d2 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 13 Feb 2023 13:05:55 +0000 Subject: change blank and ubqorange tiles from false and true to 0 and 9 --- server/chunk.lua | 4 ++++ server/server.lua | 4 ++-- server/worldgen.lua | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'server') 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)) -- cgit v1.2.3