From 1186719e62eb0b1d873d4f13635eac3a23fde5da Mon Sep 17 00:00:00 2001 From: EvilFactory Date: Wed, 12 Apr 2023 12:45:06 -0300 Subject: [PATCH] Fixed some types not being able to be registered when they actually should --- Barotrauma/BarotraumaShared/Lua/PostSetup.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Lua/PostSetup.lua b/Barotrauma/BarotraumaShared/Lua/PostSetup.lua index ae69bd735..0ac5ec464 100644 --- a/Barotrauma/BarotraumaShared/Lua/PostSetup.lua +++ b/Barotrauma/BarotraumaShared/Lua/PostSetup.lua @@ -23,7 +23,7 @@ end local originalRegisterType = LuaUserData.RegisterType LuaUserData.RegisterType = function (typeName) - if not IsAllowed(typeName) then + if not LuaUserData.IsRegistered(typeName) and not IsAllowed(typeName) then error("Couldn't register type " .. typeName .. ".", 2) end @@ -38,8 +38,8 @@ end local originalCreateStatic = LuaUserData.CreateStatic LuaUserData.CreateStatic = function (typeName, addCallMethod) - if not IsAllowed(typeName) then - error("Couldn't register type " .. typeName .. ".", 2) + if not LuaUserData.IsRegistered(typeName) and not IsAllowed(typeName) then + error("Couldn't create static type " .. typeName .. ".", 2) end local success, result = pcall(originalCreateStatic, typeName, addCallMethod)