Update BASE:GetParent( Child ) so that it returns nil when called on BASE class

We need to know if that the BASE class has no parent.
This commit is contained in:
132nd-etcher
2017-07-12 14:55:01 +02:00
parent 33916c2631
commit 2f416ea98e

View File

@@ -276,7 +276,10 @@ end
-- @return #BASE
function BASE:GetParent( Child )
local Parent
if rawget( Child, "__" ) then
-- BASE class has no parent
if Child.ClassName == 'BASE' then
Parent = nil
elseif rawget( Child, "__" ) then
Parent = getmetatable( Child.__ ).__index
else
Parent = getmetatable( Child ).__index