diff options
author | ubq323 <ubq323@ubq323.website> | 2023-02-13 13:05:55 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-02-13 13:05:55 +0000 |
commit | 7e0a520f8efd748a13c277b3c39514aee07c74d2 (patch) | |
tree | ba92438a2c2008103bb5af6acb0e01538fa15dce /server | |
parent | 0abc0b9b7928cd72b1c92b3af9f30674397013d1 (diff) |
change blank and ubqorange tiles from false and true to 0 and 9
Diffstat (limited to 'server')
-rw-r--r-- | server/chunk.lua | 4 | ||||
-rw-r--r-- | server/server.lua | 4 | ||||
-rw-r--r-- | server/worldgen.lua | 2 |
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)) |