mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-26 09:13:44 +01:00
player_info: switch if-else to avoid negation
This commit is contained in:
parent
354a44a675
commit
b3650118d2
8
init.lua
8
init.lua
@ -316,14 +316,14 @@ function cc.player_info(player_name, params)
|
|||||||
local summary = S("@1 is in the following factions: @2.",
|
local summary = S("@1 is in the following factions: @2.",
|
||||||
player_name, table.concat(player_factions, ", "))
|
player_name, table.concat(player_factions, ", "))
|
||||||
local owned_factions = factions.get_owned_factions(player_name)
|
local owned_factions = factions.get_owned_factions(player_name)
|
||||||
if not owned_factions then
|
if owned_factions then
|
||||||
summary = summary .. "\n" .. S(
|
|
||||||
"@1 doesn't own any factions.", player_name)
|
|
||||||
else
|
|
||||||
summary = summary .. "\n" .. S(
|
summary = summary .. "\n" .. S(
|
||||||
"@1 is the owner of the following factions: @2.",
|
"@1 is the owner of the following factions: @2.",
|
||||||
player_name, table.concat(owned_factions, ", ")
|
player_name, table.concat(owned_factions, ", ")
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
summary = summary .. "\n" .. S(
|
||||||
|
"@1 doesn't own any factions.", player_name)
|
||||||
end
|
end
|
||||||
if minetest.get_player_privs(player_name)[factions.priv] then
|
if minetest.get_player_privs(player_name)[factions.priv] then
|
||||||
summary = summary .. "\n" .. S(
|
summary = summary .. "\n" .. S(
|
||||||
|
Loading…
Reference in New Issue
Block a user