From e03f8fe129c75861872a66be8c89e9f141062ac2 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Mon, 16 Sep 2024 15:54:34 +0200 Subject: [PATCH] move settings higher up where they are expected to be --- init.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index e28cb98..350b7ac 100644 --- a/init.lua +++ b/init.lua @@ -6,6 +6,15 @@ factions = {} -- This variable "version" can be used by other mods to check the compatibility of this mod factions.version = 2 +-- Settings +factions.mode_unique_faction = minetest.settings:get_bool( + "player_factions.mode_unique_faction", true) +factions.max_members_list = tonumber(minetest.settings:get( + "player_factions.max_members_list")) or 50 +factions.priv = minetest.settings:get( + "player_factions.priv_admin") or "playerfactions_admin" + +-- Privilege registration (if needed) minetest.register_on_mods_loaded(function() if not minetest.registered_privileges[factions.priv] then minetest.register_privilege(factions.priv, { @@ -22,9 +31,6 @@ if storage:get_string("facts") ~= "" then facts = minetest.deserialize(storage:get_string("facts")) end -factions.mode_unique_faction = minetest.settings:get_bool("player_factions.mode_unique_faction", true) -factions.max_members_list = tonumber(minetest.settings:get("player_factions.max_members_list")) or 50 -factions.priv = minetest.settings:get("player_factions.priv_admin") or "playerfactions_admin" local function save_factions()