fix: stdcomp calling non-component global functions

This commit is contained in:
MihailRis 2026-08-07 23:04:12 +03:00
parent ec8326f3ed
commit 64a5a74f53

View file

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