From 3bc8f06e58c43e1f4e20c0f7a053f20f511b52df Mon Sep 17 00:00:00 2001 From: EvilFactory Date: Sat, 10 Jun 2023 20:36:29 -0300 Subject: [PATCH] Throw a nicer error message if the user tries to use cl_lua without it being initialized --- Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs index 700685753..8b97bf9ec 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/DebugConsole.cs @@ -3389,6 +3389,12 @@ namespace Barotrauma return; } + if (GameMain.LuaCs.Lua == null) + { + ThrowError("LuaCs not initialized, use the console command cl_reloadluacs to force initialization."); + return; + } + try { GameMain.LuaCs.Lua.DoString(string.Join(" ", args));