From 729cef7f3c833109ba143b6d09c6301b6817756a Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Sat, 1 Jan 2022 11:38:29 -0300 Subject: [PATCH] allow client-side lua to be reloaded in multiplayer --- .../ClientSource/DebugConsole.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs index 2f1238322..fd1733473 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs @@ -3213,13 +3213,7 @@ namespace Barotrauma commands.Add(new Command("cl_lua", "lua_cl: runs a string on the client", (string[] args) => { - if (GameMain.Client == null) - { - ThrowError("Client not connected to a server."); - return; - } - - if (!GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands)) + if (GameMain.Client != null && !GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands)) { ThrowError("Command not permitted."); return; @@ -3230,13 +3224,7 @@ namespace Barotrauma commands.Add(new Command("cl_reloadlua", "reloads lua on the client", (string[] args) => { - if (GameMain.Client == null) - { - ThrowError("Client not connected to a server."); - return; - } - - if (!GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands)) + if (GameMain.Client != null && !GameMain.Client.HasPermission(ClientPermissions.ConsoleCommands)) { ThrowError("Command not permitted."); return;