diff --git a/doc/en/content-packs.md b/doc/en/content-packs.md index c193fb188..48ec57e6d 100644 --- a/doc/en/content-packs.md +++ b/doc/en/content-packs.md @@ -12,7 +12,7 @@ Content-pack folder must contain file **package.json** with following contents: { "id": "pack_id", "title": "pack name will be displayed in the content menu", - "version": "content-pack version - major.minor", + "version": "content-pack version - major.minor.[patch])", "creator": "content-pack creator", "description": "short description", "dependencies": [ @@ -26,6 +26,7 @@ Dependency levels are indicated by prefixes in the name: - '!' - required dependency - '?' - optional dependency - '~' - weak dependency + If prefix is not specified, '!' level will be used. Example: '~randutil' - weak dependency 'randutil'. diff --git a/doc/ru/content-packs.md b/doc/ru/content-packs.md index 32f9be593..4ab002104 100644 --- a/doc/ru/content-packs.md +++ b/doc/ru/content-packs.md @@ -12,7 +12,7 @@ { "id": "выбранное_имя_пака", "title": "имя контент-пака для отображения в меню контента", - "version": "версия контент-пака в формате major.minor", + "version": "версия контент-пака в формате major.minor.[patch]", "creator": "создатель контент-пака", "description": "краткое описание", "dependencies": [ @@ -28,6 +28,7 @@ - '!' - обязательная зависимость - '?' - опциональная зависимость - '~' - слабая зависимость + Отсутствие префикса интерпретируется как '!'. Пример: '~randutil' - слабая зависимость 'randutil'. diff --git a/res/modules/internal/stdcomp.lua b/res/modules/internal/stdcomp.lua index 4278f14f6..dbf7f9776 100644 --- a/res/modules/internal/stdcomp.lua +++ b/res/modules/internal/stdcomp.lua @@ -129,7 +129,7 @@ return { goto continue end for _, component in pairs(entity.components) do - local callback = component.on_update + local callback = rawget(component, "on_update") if not component.__disabled and callback then local result, err = pcall(callback, tps) if err then @@ -143,7 +143,7 @@ return { physics_update = function(delta) for uid, entity in pairs(entities) do for _, component in pairs(entity.components) do - local callback = component.on_physics_update + local callback = rawget(component, "on_physics_update") if not component.__disabled and callback then local result, err = pcall(callback, delta) if err then @@ -156,7 +156,7 @@ return { render = function(delta) for _,entity in pairs(entities) do for _, component in pairs(entity.components) do - local callback = component.on_render + local callback = rawget(component, "on_render") if not component.__disabled and callback then local result, err = pcall(callback, delta) if err then