mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fix to get correct parent class
This commit is contained in:
parent
4c5aad51b3
commit
5bbe5fca60
@ -254,7 +254,7 @@ function BASE:Inherit( Child, Parent )
|
|||||||
-- This is for "private" methods...
|
-- This is for "private" methods...
|
||||||
-- When a __ is passed to a method as "self", the __index will search for the method on the public method list of the same object too!
|
-- When a __ is passed to a method as "self", the __index will search for the method on the public method list of the same object too!
|
||||||
if rawget( Child, "__" ) then
|
if rawget( Child, "__" ) then
|
||||||
setmetatable( Child, { __index = Child.__ } )
|
setmetatable( Child, { __index = Child.__ } )
|
||||||
setmetatable( Child.__, { __index = Parent } )
|
setmetatable( Child.__, { __index = Parent } )
|
||||||
else
|
else
|
||||||
setmetatable( Child, { __index = Parent } )
|
setmetatable( Child, { __index = Parent } )
|
||||||
@ -277,9 +277,9 @@ end
|
|||||||
function BASE:GetParent( Child )
|
function BASE:GetParent( Child )
|
||||||
local Parent
|
local Parent
|
||||||
if rawget( Child, "__" ) then
|
if rawget( Child, "__" ) then
|
||||||
Parent = getmetatable( Child.__ ).__Index
|
Parent = getmetatable( Child.__ ).__index
|
||||||
else
|
else
|
||||||
Parent = getmetatable( Child ).__Index
|
Parent = getmetatable( Child ).__index
|
||||||
end
|
end
|
||||||
return Parent
|
return Parent
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user