Fix: crash on /f who when not in a faction

This commit is contained in:
Coder12a 2019-05-04 14:09:20 -05:00
parent 073c2288e3
commit b4a85766df

View File

@ -940,14 +940,12 @@ factions.register_command("who", {
on_success = function(player, faction, pos, parcelpos, args) on_success = function(player, faction, pos, parcelpos, args)
local str = args.strings[1] local str = args.strings[1]
local f = {}
if str then if str then
f = factions.get_faction(str) local f = factions.get_faction(str)
if not f and not f.players then if not f and not f.players then
f = factions.get_player_faction(player) f = factions.get_player_faction(player)
if not f and 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, "Your not in a faction.")
return return
else else
@ -965,8 +963,8 @@ factions.register_command("who", {
return true return true
end end
else else
f = factions.get_player_faction(player) local f = factions.get_player_faction(player)
if not f and 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, "Your not in a faction.")
return return
else else