mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-25 16:53:47 +01:00
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:
parent
fb8f7baf4f
commit
f02f6d56e6
7
init.lua
7
init.lua
@ -255,10 +255,11 @@ local function handle_command(name, param)
|
||||
for k in pairs(facts) do
|
||||
table.insert(faction_list, k)
|
||||
end
|
||||
if #faction_list ~= 0 then
|
||||
return true, S("Factions (@1): @2.", #faction_list, table.concat(faction_list, ", "))
|
||||
else
|
||||
if #faction_list == 0 then
|
||||
return true, S("There are no factions yet.")
|
||||
else
|
||||
return true, S("Factions (@1): @2.",
|
||||
#faction_list, table.concat(faction_list, ", "))
|
||||
end
|
||||
elseif action == "info" then
|
||||
local faction_name = params[2]
|
||||
|
Loading…
Reference in New Issue
Block a user