mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-22 07:13:50 +01:00
check if player faction is nil
This commit is contained in:
parent
50335b7ceb
commit
639f5aa716
5
init.lua
5
init.lua
@ -256,7 +256,10 @@ local function handle_command(name, param)
|
|||||||
local faction_name = params[2]
|
local faction_name = params[2]
|
||||||
if faction_name == nil then
|
if faction_name == nil then
|
||||||
local player_factions = factions.get_player_factions(name)
|
local player_factions = factions.get_player_factions(name)
|
||||||
if #player_factions == 1 then
|
if not player_factions then
|
||||||
|
minetest.chat_send_player(name, S("no faction found"))
|
||||||
|
return false
|
||||||
|
elseif #player_factions == 1 then
|
||||||
faction_name = player_factions[1]
|
faction_name = player_factions[1]
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name, S("You are in many factions, you have to choose one of them: @1.", table.concat(player_factions, ", ")))
|
minetest.chat_send_player(name, S("You are in many factions, you have to choose one of them: @1.", table.concat(player_factions, ", ")))
|
||||||
|
Loading…
Reference in New Issue
Block a user