mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update on_physics_update & update standard components
This commit is contained in:
parent
2d29b8c46c
commit
bf682daffe
9 changed files with 12 additions and 29 deletions
|
|
@ -133,21 +133,17 @@ return {
|
|||
::continue::
|
||||
end
|
||||
end,
|
||||
physics_update = function(tps, parts, part)
|
||||
physics_update = function(delta)
|
||||
for uid, entity in pairs(entities) do
|
||||
if uid % parts ~= part then
|
||||
goto continue
|
||||
end
|
||||
for _, component in pairs(entity.components) do
|
||||
local callback = component.on_physics_update
|
||||
if not component.__disabled and callback then
|
||||
local result, err = pcall(callback, tps)
|
||||
local result, err = pcall(callback, delta)
|
||||
if err then
|
||||
debug.error(err)
|
||||
end
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
end,
|
||||
render = function(delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue