mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
fix: stdcomp calling non-component global functions
This commit is contained in:
parent
ec8326f3ed
commit
64a5a74f53
1 changed files with 3 additions and 3 deletions
|
|
@ -129,7 +129,7 @@ return {
|
||||||
goto continue
|
goto continue
|
||||||
end
|
end
|
||||||
for _, component in pairs(entity.components) do
|
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
|
if not component.__disabled and callback then
|
||||||
local result, err = pcall(callback, tps)
|
local result, err = pcall(callback, tps)
|
||||||
if err then
|
if err then
|
||||||
|
|
@ -143,7 +143,7 @@ return {
|
||||||
physics_update = function(delta)
|
physics_update = function(delta)
|
||||||
for uid, entity in pairs(entities) do
|
for uid, entity in pairs(entities) do
|
||||||
for _, component in pairs(entity.components) 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
|
if not component.__disabled and callback then
|
||||||
local result, err = pcall(callback, delta)
|
local result, err = pcall(callback, delta)
|
||||||
if err then
|
if err then
|
||||||
|
|
@ -156,7 +156,7 @@ return {
|
||||||
render = function(delta)
|
render = function(delta)
|
||||||
for _,entity in pairs(entities) do
|
for _,entity in pairs(entities) do
|
||||||
for _, component in pairs(entity.components) 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
|
if not component.__disabled and callback then
|
||||||
local result, err = pcall(callback, delta)
|
local result, err = pcall(callback, delta)
|
||||||
if err then
|
if err then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue