summaryrefslogtreecommitdiff
path: root/server/src/emmy
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/emmy')
-rw-r--r--server/src/emmy/class.lua4
-rw-r--r--server/src/emmy/manager.lua3
2 files changed, 4 insertions, 3 deletions
diff --git a/server/src/emmy/class.lua b/server/src/emmy/class.lua
index 69d731ee..33a01be2 100644
--- a/server/src/emmy/class.lua
+++ b/server/src/emmy/class.lua
@@ -3,7 +3,7 @@ mt.__index = mt
mt.type = 'emmy.class'
function mt:getType()
- return self._name
+ return self.name
end
return function (class, parent)
@@ -11,6 +11,6 @@ return function (class, parent)
name = class[1],
source = class.id,
parent = parent and parent.id,
- })
+ }, mt)
return self
end
diff --git a/server/src/emmy/manager.lua b/server/src/emmy/manager.lua
index 5f83c9d1..8ca102ca 100644
--- a/server/src/emmy/manager.lua
+++ b/server/src/emmy/manager.lua
@@ -39,6 +39,7 @@ end
function mt:addClass(class, parent)
local className = class[1]
+ self:flushClass(className)
local list = self._class[className]
local version = listMgr.getVersion()
if not list then
@@ -48,7 +49,7 @@ function mt:addClass(class, parent)
self._class[className] = list
end
list[class.id] = newClass(class, parent)
- self:flushClass(className)
+ return list[class.id]
end
function mt:remove()