mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'on_physics_update' entity event
This commit is contained in:
parent
b60f0f0ea2
commit
6d3dac9106
6 changed files with 42 additions and 3 deletions
|
|
@ -279,6 +279,16 @@ void scripting::on_entities_update(int tps, int parts, int part) {
|
|||
lua::pop(L);
|
||||
}
|
||||
|
||||
void scripting::on_entities_physics_update(int tps, int parts, int part) {
|
||||
auto L = lua::get_main_state();
|
||||
lua::get_from(L, STDCOMP, "physics_update", true);
|
||||
lua::pushinteger(L, tps);
|
||||
lua::pushinteger(L, parts);
|
||||
lua::pushinteger(L, part);
|
||||
lua::call_nothrow(L, 3, 0);
|
||||
lua::pop(L);
|
||||
}
|
||||
|
||||
void scripting::on_entities_render(float delta) {
|
||||
auto L = lua::get_main_state();
|
||||
lua::get_from(L, STDCOMP, "render", true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue