mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix on_block_interact & fix segfault after engine finished
This commit is contained in:
parent
e0670c11d5
commit
d1f92c21d0
6 changed files with 12 additions and 7 deletions
|
|
@ -368,7 +368,7 @@ bool scripting::on_block_interact(
|
|||
Player* player, const Block& block, const glm::ivec3& pos
|
||||
) {
|
||||
std::string name = block.name + ".interact";
|
||||
return lua::emit_event(lua::get_main_state(), name, [pos, player](auto L) {
|
||||
auto result = lua::emit_event(lua::get_main_state(), name, [pos, player](auto L) {
|
||||
lua::pushivec_stack(L, pos);
|
||||
lua::pushinteger(L, player->getId());
|
||||
return 4;
|
||||
|
|
@ -386,6 +386,7 @@ bool scripting::on_block_interact(
|
|||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void scripting::on_player_tick(Player* player, int tps) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue