mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-26 01:03:48 +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 target = 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
|
||||
return false, S("Missing password.")
|
||||
else
|
||||
return false, S("Missing player name.")
|
||||
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
|
||||
faction_name = own_factions[1]
|
||||
target = params[2]
|
||||
|
Loading…
Reference in New Issue
Block a user