Fixed some types not being able to be registered when they actually should
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user