add 'on_physics_update' entity event
This commit is contained in:
@@ -130,6 +130,7 @@ namespace scripting {
|
||||
void on_entity_fall(const Entity& entity);
|
||||
void on_entity_save(const Entity& entity);
|
||||
void on_entities_update(int tps, int parts, int part);
|
||||
void on_entities_physics_update(int tps, int parts, int part);
|
||||
void on_entities_render(float delta);
|
||||
void on_sensor_enter(const Entity& entity, size_t index, entityid_t oid);
|
||||
void on_sensor_exit(const Entity& entity, size_t index, entityid_t oid);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user