list: check for true first instead of using negation

- check for no factions first -> simpler code
- whitespace: linebreak for easier reading
This commit is contained in:
Luke aka SwissalpS 2024-09-15 03:52:54 +02:00
parent fb8f7baf4f
commit f02f6d56e6

@ -255,10 +255,11 @@ local function handle_command(name, param)
for k in pairs(facts) do for k in pairs(facts) do
table.insert(faction_list, k) table.insert(faction_list, k)
end end
if #faction_list ~= 0 then if #faction_list == 0 then
return true, S("Factions (@1): @2.", #faction_list, table.concat(faction_list, ", "))
else
return true, S("There are no factions yet.") return true, S("There are no factions yet.")
else
return true, S("Factions (@1): @2.",
#faction_list, table.concat(faction_list, ", "))
end end
elseif action == "info" then elseif action == "info" then
local faction_name = params[2] local faction_name = params[2]