wrap fixup code in do-block

variable save_needed is not used for anything else
This commit is contained in:
Luke aka SwissalpS 2024-09-15 00:06:17 +02:00
parent e21bd17ace
commit a87e59afee

@ -546,8 +546,9 @@ minetest.register_chatcommand("factions", {
})
-- Fix factions
local save_needed = false
for _, fact in pairs(facts) do
do
local save_needed = false
for _, fact in pairs(facts) do
if not fact.members then
fact.members = {}
end
@ -556,9 +557,10 @@ for _, fact in pairs(facts) do
fact.password = nil
save_needed = true
end
end
if save_needed then
end
if save_needed then
save_factions()
end
end
print("[playerfactions] loaded")