Update nodedb.lua

correct read/write file binary data
h137
imcasper 2018-06-05 03:21:23 +03:00 committed by orwell96
parent 3d7924c751
commit 105aacccf9
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ local path=minetest.get_worldpath()..DIR_DELIM.."advtrains_ndb2"
--nodeids get loaded by advtrains init.lua and passed here
function ndb.load_data(data)
ndb_nodeids = data and data.nodeids or {}
local file, err = io.open(path, "r")
local file, err = io.open(path, "rb")
if not file then
atwarn("Couldn't load the node database: ", err or "Unknown Error")
else
@ -81,7 +81,7 @@ end
--save
function ndb.save_data()
local file, err = io.open(path, "w")
local file, err = io.open(path, "wb")
if not file then
atwarn("Couldn't save the node database: ", err or "Unknown Error")
else