mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-12-01 19:54:01 +01:00
chown: reorder to first check if player has any factions at all
There is no point in checking other params if this part fails.
This commit is contained in:
parent
442c2c5209
commit
75ff73a45c
6
init.lua
6
init.lua
@ -458,14 +458,14 @@ local function handle_command(name, param)
|
|||||||
local faction_name = nil
|
local faction_name = nil
|
||||||
local target = nil
|
local target = nil
|
||||||
local password = nil
|
local password = nil
|
||||||
if #params < 3 then
|
if number_factions == 0 then
|
||||||
|
return false, S("You are the owner of no faction, you can't use this command.")
|
||||||
|
elseif #params < 3 then
|
||||||
if params[2] ~= nil and minetest.player_exists(params[2]) then
|
if params[2] ~= nil and minetest.player_exists(params[2]) then
|
||||||
return false, S("Missing password.")
|
return false, S("Missing password.")
|
||||||
else
|
else
|
||||||
return false, S("Missing player name.")
|
return false, S("Missing player name.")
|
||||||
end
|
end
|
||||||
elseif number_factions == 0 then
|
|
||||||
return false, S("You are the owner of no faction, you can't use this command.")
|
|
||||||
elseif number_factions == 1 and #params == 3 then
|
elseif number_factions == 1 and #params == 3 then
|
||||||
faction_name = own_factions[1]
|
faction_name = own_factions[1]
|
||||||
target = params[2]
|
target = params[2]
|
||||||
|
Loading…
Reference in New Issue
Block a user