diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsHook.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsHook.cs index b9a579ef3..c542a9272 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsHook.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsHook.cs @@ -98,13 +98,13 @@ namespace Barotrauma public void Add(string name, string hookName, LuaCsFunc hook, ACsMod owner = null) { - name = name.ToLower(); - if (name == null || hookName == null || hook == null) { throw new ScriptRuntimeException("Hook.Add: name, hookName and hook must not be null."); } + name = name.ToLower(); + if (!hookFunctions.ContainsKey(name)) { hookFunctions.Add(name, new Dictionary());