Fix: who cmd crashes on invaild faction name
This commit is contained in:
parent
8e98bf8b62
commit
a1cebc3a24
@ -942,11 +942,8 @@ factions.register_command("who", {
|
|||||||
|
|
||||||
if str then
|
if str then
|
||||||
local f = factions.get_faction(str)
|
local f = factions.get_faction(str)
|
||||||
|
|
||||||
if not f and not f.players then
|
|
||||||
f = factions.get_player_faction(player)
|
|
||||||
if not f or not f.players then
|
if not f or not f.players then
|
||||||
minetest.chat_send_player(player, "Your not in a faction.")
|
minetest.chat_send_player(player, "Faction " .. str .. " does not exist.")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(player, "Players in faction " .. f.name .. ": ")
|
minetest.chat_send_player(player, "Players in faction " .. f.name .. ": ")
|
||||||
@ -955,13 +952,6 @@ factions.register_command("who", {
|
|||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
else
|
|
||||||
minetest.chat_send_player(player, "Players in faction " .. f.name .. ": ")
|
|
||||||
for p, rank in pairs(f.players) do
|
|
||||||
minetest.chat_send_player(player, p .." (" .. rank .. ")")
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
local f = factions.get_player_faction(player)
|
local f = factions.get_player_faction(player)
|
||||||
if not f or not f.players then
|
if not f or not f.players then
|
||||||
|
Loading…
Reference in New Issue
Block a user