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
|
local originalRegisterType = LuaUserData.RegisterType
|
||||||
LuaUserData.RegisterType = function (typeName)
|
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)
|
error("Couldn't register type " .. typeName .. ".", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ end
|
|||||||
|
|
||||||
local originalCreateStatic = LuaUserData.CreateStatic
|
local originalCreateStatic = LuaUserData.CreateStatic
|
||||||
LuaUserData.CreateStatic = function (typeName, addCallMethod)
|
LuaUserData.CreateStatic = function (typeName, addCallMethod)
|
||||||
if not IsAllowed(typeName) then
|
if not LuaUserData.IsRegistered(typeName) and not IsAllowed(typeName) then
|
||||||
error("Couldn't register type " .. typeName .. ".", 2)
|
error("Couldn't create static type " .. typeName .. ".", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
local success, result = pcall(originalCreateStatic, typeName, addCallMethod)
|
local success, result = pcall(originalCreateStatic, typeName, addCallMethod)
|
||||||
|
|||||||
Reference in New Issue
Block a user