diff --git a/mods/CORE/Creature/src/Creature.lua b/mods/CORE/Creature/src/Creature.lua index 7619a77..1b2cd5a 100644 --- a/mods/CORE/Creature/src/Creature.lua +++ b/mods/CORE/Creature/src/Creature.lua @@ -55,7 +55,7 @@ function Creature:new(entityDef) -- We rewrite the entity initialization function so that custom fields -- can be passed to it directly via `core.add_entity(pos, name, [staticdata])`. - c.on_activate = function(self, staticdata, dtime) + c.on_activate = function(luaEntity, staticdata, dtime) local initCustomFields = {} if staticdata and staticdata ~= '' then @@ -71,7 +71,7 @@ function Creature:new(entityDef) -- If an initialization callback was specified for the entity, then we call it. if c.on_activate ~= nil then - onActivate(self, staticdata, dtime) + onActivate(luaEntity, staticdata, dtime) end end @@ -83,7 +83,7 @@ function Creature:new(entityDef) instance.entityDef = entityDef instance.luantiDef = luantiDef - core.register_entity(s._name, luantiDef) + core.register_entity(':'..s._name, luantiDef) return instance end