From 0aa297669715bcdb91b186b7e6d4a4cf06d30b7f Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:04:49 -0300 Subject: [PATCH] only allow cs commands if cs package present --- Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs | 2 ++ Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs index e896f8668..3d01a6b36 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs @@ -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."); diff --git a/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs b/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs index c20df59de..40c6d5935 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/DebugConsole.cs @@ -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)); }));