mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
refactor: PlayerController
This commit is contained in:
parent
b3ae8484a2
commit
4e696520b6
13 changed files with 207 additions and 186 deletions
|
|
@ -192,10 +192,10 @@ void scripting::on_block_broken(Player* player, const Block* block, int x, int y
|
|||
});
|
||||
}
|
||||
|
||||
bool scripting::on_block_interact(Player* player, const Block* block, int x, int y, int z) {
|
||||
bool scripting::on_block_interact(Player* player, const Block* block, glm::ivec3 pos) {
|
||||
std::string name = block->name + ".interact";
|
||||
return state->emit_event(name, [x, y, z, player] (lua::LuaState* state) {
|
||||
state->pushivec3(x, y, z);
|
||||
return state->emit_event(name, [pos, player] (lua::LuaState* state) {
|
||||
state->pushivec3(pos.x, pos.y, pos.z);
|
||||
state->pushinteger(player->getId());
|
||||
return 4;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue