mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
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:
parent
33916c2631
commit
2f416ea98e
@ -276,7 +276,10 @@ end
|
|||||||
-- @return #BASE
|
-- @return #BASE
|
||||||
function BASE:GetParent( Child )
|
function BASE:GetParent( Child )
|
||||||
local Parent
|
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
|
Parent = getmetatable( Child.__ ).__index
|
||||||
else
|
else
|
||||||
Parent = getmetatable( Child ).__index
|
Parent = getmetatable( Child ).__index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user