diff options
-rw-r--r-- | init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -16,9 +16,11 @@ pipeworks.modpath = minetest.get_modpath("pipeworks") dofile(pipeworks.modpath.."/default_settings.txt") -- Read the external config file if it exists. -if io.open(pipeworks.worldpath.."/pipeworks_settings.txt","r") then - dofile(pipeworks.worldpath.."/pipeworks_settings.txt") - io.close() +local worldsettingspath = pipeworks.worldpath.."/pipeworks_settings.txt","r" +local worldsettingsfile = io.open(worldsettingspath) +if worldsettingsfile then + worldsettingsfile:close() + dofile(worldsettingspath) end -- Random variables |