only allow cs commands if cs package present

This commit is contained in:
Evil Factory
2022-04-20 20:04:49 -03:00
parent 5db4be7db5
commit 0aa2976697
2 changed files with 4 additions and 0 deletions

View File

@@ -3227,6 +3227,8 @@ namespace Barotrauma
}));
commands.Add(new Command("cl_cs", "cs_cl: runs a string on the client", (string[] args) =>
{
if (LuaCsSetup.GetPackage("CsForBarotrauma", false) == null) { return; }
if (GameMain.Client != null && !GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands))
{
ThrowError("Command not permitted.");

View File

@@ -1247,6 +1247,8 @@ namespace Barotrauma
}));
commands.Add(new Command("cs", "cs: runs a string", (string[] args) =>
{
if(LuaCsSetup.GetPackage("CsForBarotrauma", false) == null) { return; }
GameMain.LuaCs.CsScript.Run(string.Join(" ", args));
}));