mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-26 09:13:44 +01:00
wrap fixup code in do-block
variable save_needed is not used for anything else
This commit is contained in:
parent
e21bd17ace
commit
a87e59afee
24
init.lua
24
init.lua
@ -546,19 +546,21 @@ minetest.register_chatcommand("factions", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Fix factions
|
-- Fix factions
|
||||||
local save_needed = false
|
do
|
||||||
for _, fact in pairs(facts) do
|
local save_needed = false
|
||||||
if not fact.members then
|
for _, fact in pairs(facts) do
|
||||||
fact.members = {}
|
if not fact.members then
|
||||||
|
fact.members = {}
|
||||||
|
end
|
||||||
|
if fact.password then
|
||||||
|
fact.password256 = factions.hash_password(fact.password)
|
||||||
|
fact.password = nil
|
||||||
|
save_needed = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if fact.password then
|
if save_needed then
|
||||||
fact.password256 = factions.hash_password(fact.password)
|
save_factions()
|
||||||
fact.password = nil
|
|
||||||
save_needed = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if save_needed then
|
|
||||||
save_factions()
|
|
||||||
end
|
|
||||||
|
|
||||||
print("[playerfactions] loaded")
|
print("[playerfactions] loaded")
|
||||||
|
Loading…
Reference in New Issue
Block a user