diff options
author | ubq323 <ubq323@ubq323.website> | 2023-04-02 01:28:21 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-04-02 01:28:21 +0100 |
commit | 6e9a052aa877222a1a494ddcdc5507b5bcc3ea68 (patch) | |
tree | 811f9c092eb7266faf28002802b5468534b1d76c /server/chunk.lua | |
parent | e77609c5bc8b44aa22ef88063246fd05add5e705 (diff) |
minor cleaning
Diffstat (limited to 'server/chunk.lua')
-rw-r--r-- | server/chunk.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/chunk.lua b/server/chunk.lua index 852f1fe..bb30945 100644 --- a/server/chunk.lua +++ b/server/chunk.lua @@ -34,12 +34,11 @@ function ChunkS.load_from_disk(cls,cp) return self end -function ChunkS.save_if_dirty(self) +function ChunkS.save_if_dirty(self,txn) if self.dirty then print("saving chunk",self.cp) - local txn,dbi = db.get_db('chunks',true) + local dbi = txn:open'chunks' dbi[tostring(self.cp)] = self:data_packet() - txn:commit() self.dirty = false end end |