Only load the default ranks.lua file if the world directory does not already contain one. it makes no sense to load 2 ranks.lua files.

This commit is contained in:
Ryan Nolan 2017-12-14 18:28:20 +00:00
parent 5dd9b20b52
commit 98311a2ed3

View File

@ -419,10 +419,10 @@ end
---
-- Load default ranks
dofile(minetest.get_modpath("ranks").."/ranks.lua")
local path = minetest.get_worldpath().."/ranks.lua"
-- Attempt to load per-world ranks
if io.open(path) then
dofile(path)
else
dofile(minetest.get_modpath("ranks").."/ranks.lua")
end