CraftSystem: first working version #31

Merged
varttist merged 27 commits from craft-system into main 2026-02-18 19:30:39 +00:00
Showing only changes of commit 97292d6205 - Show all commits

View File

@@ -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