From 3800868b4082e6ecb42fc1b035c59f2bc2169faa Mon Sep 17 00:00:00 2001 From: Supergoat666 <47240900+Supergoat666@users.noreply.github.com> Date: Wed, 26 Aug 2020 11:10:27 +0200 Subject: [PATCH] Raise 'invalid use' error if no faction_name is given --- chatcommands.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chatcommands.lua b/chatcommands.lua index 1ff0241..c885241 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -292,8 +292,9 @@ if areas.factions_available then local params = param:split(" ") local id = tonumber(params[1]) + local faction_name = params[2] - if not id then + if not id or not faction_name then return false, S("Invalid usage, see /help @1.", "area_faction_open") end @@ -302,7 +303,7 @@ if areas.factions_available then .." or is not owned by you.", id) end - local faction_name = params[2] + if not factions.get_owner(faction_name) then return false, S("Faction doesn't exists") end