From 2f416ea98ec8ac73d4cd7eab627692bd9e25a1d5 Mon Sep 17 00:00:00 2001 From: 132nd-etcher <132nd-etcher@daribouca.net> Date: Wed, 12 Jul 2017 14:55:01 +0200 Subject: [PATCH] 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. --- Moose Development/Moose/Core/Base.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua index b9e218703..101204c1f 100644 --- a/Moose Development/Moose/Core/Base.lua +++ b/Moose Development/Moose/Core/Base.lua @@ -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