mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add on_update, on_render to docs & change entities tps to 20
This commit is contained in:
parent
3f67944cc2
commit
f8907f7db1
10 changed files with 62 additions and 21 deletions
|
|
@ -475,17 +475,21 @@ void scripting::on_entity_used(const Entity& entity, Player* player) {
|
|||
});
|
||||
}
|
||||
|
||||
void scripting::on_entities_update() {
|
||||
void scripting::on_entities_update(int tps, int parts, int part) {
|
||||
auto L = lua::get_main_thread();
|
||||
lua::get_from(L, STDCOMP, "update", true);
|
||||
lua::call_nothrow(L, 0, 0);
|
||||
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() {
|
||||
void scripting::on_entities_render(float delta) {
|
||||
auto L = lua::get_main_thread();
|
||||
lua::get_from(L, STDCOMP, "render", true);
|
||||
lua::call_nothrow(L, 0, 0);
|
||||
lua::pushnumber(L, delta);
|
||||
lua::call_nothrow(L, 1, 0);
|
||||
lua::pop(L);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue