diff options
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 |