summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 92ce02c..8593fdb 100644
--- a/init.lua
+++ b/init.lua
@@ -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