diff options
author | ubq323 <ubq323@ubq323.website> | 2023-02-11 15:33:13 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-02-11 15:33:13 +0000 |
commit | b4c189ab1b6233c7e7e260446e80b789f375b5d6 (patch) | |
tree | a051262e11172ccd65015fc89f4b92adf0de2ae7 /server/chunk.lua | |
parent | 81ee73e37348eaae6b1e4a23378d13d129133904 (diff) |
change from random worldgen to be based on a hash of position; implement serverside chunk unloading
Diffstat (limited to 'server/chunk.lua')
-rw-r--r-- | server/chunk.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/chunk.lua b/server/chunk.lua index 4fb2960..1e2e135 100644 --- a/server/chunk.lua +++ b/server/chunk.lua @@ -5,7 +5,7 @@ local json = require"common.dkjson" local ChunkS = class.extend(Chunk) function ChunkS.make(cls,...) local self = Chunk.make(cls,...) - self.dirty = true + self.dirty = false return self end function ChunkS.load_from_disk(cls,cp) @@ -26,6 +26,7 @@ function ChunkS.save_if_dirty(self) f:write(self:data_packet()) f:flush() f:close() + self.dirty = false end end function ChunkS.set_at(self,...) |