mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fixed block rclick function (error 2 commits ago)
This commit is contained in:
parent
3ac32b6696
commit
24dc38c780
1 changed files with 8 additions and 5 deletions
|
|
@ -298,12 +298,15 @@ void PlayerController::updateInteraction(){
|
|||
blocksController->breakBlock(player.get(), target, x, y, z);
|
||||
}
|
||||
if (rclick && !input.shift) {
|
||||
bool preventDefault = false;
|
||||
if (item->rt.funcsset.on_use_on_block) {
|
||||
scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
||||
} else
|
||||
if (item->rt.funcsset.on_use) {
|
||||
scripting::on_item_use(player.get(), item);
|
||||
} else return;
|
||||
preventDefault = scripting::on_item_use_on_block(player.get(), item, x, y, z);
|
||||
} else if (item->rt.funcsset.on_use) {
|
||||
preventDefault = scripting::on_item_use(player.get(), item);
|
||||
}
|
||||
if (preventDefault) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (def && rclick){
|
||||
if (!input.shift && target->rt.funcsset.oninteract) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue