File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,6 @@ local function read_file(filename)
8686 return core .deserialize (t ) or {}
8787end
8888
89- local function write_file (filename , table )
90- local f = io.open (filename , " w" )
91- f :write (core .serialize (table ))
92- f :close ()
93- end
94-
9589blocks_forceloaded = read_file (wpath .. " /force_loaded.txt" )
9690for _ , __ in pairs (blocks_forceloaded ) do
9791 total_forceloaded = total_forceloaded + 1
106100
107101-- persists the currently forceloaded blocks to disk
108102local function persist_forceloaded_blocks ()
109- write_file (wpath .. " /force_loaded.txt" , blocks_forceloaded )
103+ local data = core .serialize (blocks_forceloaded )
104+ core .safe_file_write (wpath .. " /force_loaded.txt" , data )
110105end
111106
112107-- periodical forceload persistence
You can’t perform that action at this time.
0 commit comments