CraftSystem: first working version
#31
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user