From 6e9a052aa877222a1a494ddcdc5507b5bcc3ea68 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 2 Apr 2023 01:28:21 +0100 Subject: minor cleaning --- server/chunk.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/chunk.lua') 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 -- cgit v1.2.3